#create-DHCPScopes $fileData = Get-Content c:\temp\scripts\some-file.txt $fileData | %{ # header of my file - tab is separator # SHORT_SUBNET SUBNET_MASK DHCP-LO DHCP-HI GW NAME $line = $_ $tabline = $line.Split("`t") $name = $tabLine[5] $dhcpName = """$name""" $description = "some descritpion" if ($tabline[0] -ne "SHORT_SUBNET") { netsh dhcp server add scope $tabLine[0] $tabline[1] $dhcpName $description netsh dhcp server scope $tabLine[0] set state 1 netsh dhcp server scope $tabLine[0] set name $dhcpName netsh dhcp server scope $tabLine[0] set optionvalue 003 IPADDRESS $tabLine[4] netsh dhcp server scope $tabLine[0] set optionvalue 051 DWORD 2592000 netsh dhcp server scope $tabLine[0] add iprange $tabLine[2] $tabLine[3] } }
czwartek, 9 sierpnia 2018
netsh dhcp create scope
How to create dhcp scopes in older system - without dhcp module:
Subskrybuj:
Komentarze do posta (Atom)
Brak komentarzy:
Prześlij komentarz