Hi Luc,
This script seems to work really well for windows 2008 servers but when i run it against 2012 servers powercli displays (ScriptOutput |) i.e no errors but the windows ip has not changed.. The label is ethernet0 on the adapter however if i change the label in the script i get an error in powerlci saying the label symtax is incorrect
Function Set-WinVMIP ($VM, $IP, $SNM, $GW){
$cmd = @"
netsh interface ipv4 set address name="Local Area Connection" static $IP $SNM $GW 1"
"@
Invoke-VMScript -VM $VM -GuestUser xxxxxxxx -GuestPassword xxxxxxxx -ScriptText $cmd -ScriptType bat
}
Import-Csv "C:\Scripts\ipnetsh.csv" -UseCulture | %{
Set-WinVMIP $_.VM $_.IP $_.SNM $_.GW $GC
}