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   dhcp
if copy console string works doesnt normally.



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Motherboard replacement

Remote Desktop App - Error 0x207 or 0x607

Cannot create Full Text Search catalog after upgrading to V12 - Database is not fully started up or it is not in an ONLINE state