netsh ip reservation error
hi,
i trying automatically set static reservation using csv file. i have written a small powershell script doesn't seem work. if manually copy output script works doesn't work when run in script
some let me know doing wrong.
thanks
$content = import-csv .\test.csv foreach ($line in $content) { write-host "netsh dhcp server 192.168.0.16 scope 192.168.0.0 add reservedip "$line.ip" "$line.mac" "$line.machinename" "$line.machinename" "dhcp"" netsh dhcp server 192.168.0.16 scope 192.168.0.0 add reservedip "$line.ip" "$line.mac" "$line.machinename" "$line.machinename" "dhcp" }
output =
netsh dhcp server 192.168.0.16 scope 192.168.0.0 add reservedip 192.168.0.3 8i09670cc5f1 co199 co199 dhcpif copy console string works doesnt normally.
hi,
try using call operator before netsh statement.
don't retire technet! - (maybe there's still chance hope, on 12,000+ strong , growing)
Windows Server > Windows PowerShell
Comments
Post a Comment