Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 219257

Re: invoke-vmscript change guest ip address

$
0
0

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

}


Viewing all articles
Browse latest Browse all 219257

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>