16 lines
668 B
PowerShell
Executable File
16 lines
668 B
PowerShell
Executable File
if (-not (Get-WindowsFeature -Name DHCP).Installed) {
|
|
Write-Host "Le role DHCP n'est pas installer." -ForegroundColor Red
|
|
Install-WindowsFeature -Name DHCP -IncludeManagementTools
|
|
$pool = Read-Host "Nom de la pool "
|
|
$net = Read-Host "Network (en .0)"
|
|
$start = Read-Host "Start du Dhcp "
|
|
$end = Read-Host "Fin du Dhcp "
|
|
$subnet = Read-Host "Masque de sous reseaux "
|
|
$gateway = Read-Host "Gateway "
|
|
$dns = Read-Host "DNS "
|
|
Add-DhcpServerv4Scope -Name $pool -StartRange $start -EndRange $end -SubnetMask $subnet -State Active
|
|
Set-DhcpServerv4OptionValue -ScopeId $net -Router $gateway -DnsServer $dns
|
|
Get-Service dhcpserver
|
|
}
|
|
|