VMware Cloud Community
tianhailong666
Enthusiast
Enthusiast
Jump to solution

Can't setup IP via Invoke-VMScript

hello,

I want to  use powercli Invoke-Vmscript  commlet to config VM IP settings, but got below errors, anybody who has experienced or any suggestion to resolve it ? look forward your idea,thanks !

Commands:

invoke-VMScript -VM testvm -ScriptText "netsh interface ipv4 set address ""local area connection""  static 192.168.0.121 255.255.255.0 192.168.0.254" -GuestCredential $GuestCredential

Error:

ScriptOutput

Failed to configure the DHCP service. The interface may be disconnected.

The system cannot find the file specified.

PowerCli version :5.5

vSphere vsersion:5.5

VM version :Win2008R2

0 Kudos
1 Solution

Accepted Solutions
tianhailong666
Enthusiast
Enthusiast
Jump to solution

Hi LucD,

Thanks for your reply,

Actually , the conected network name was wrong,  the true name is "local area connection 2"  not "local area connection".

thanks, also hope other people aviods this error in case met this similar issue.

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

Are you sure the vNIC is in a "connected" state?

That error also appears when the NIC is disabled.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
tianhailong666
Enthusiast
Enthusiast
Jump to solution

Hi LucD,

Thanks for your reply,

Actually , the conected network name was wrong,  the true name is "local area connection 2"  not "local area connection".

thanks, also hope other people aviods this error in case met this similar issue.

0 Kudos