VMware Cloud Community
satheeshsatz
Enthusiast
Enthusiast

invoke-vmscript is failing with runas administrator elevated error :(

$script = "netsh interface ip set address ""$NIC"" static $IP $NETMASK $Gateway"

C:\Windows\system32> Invoke-VMScript -ScriptText $script -VM $VM -GuestUser "Localuser" -GuestPassword "pwd" -ScriptType Bat

WARNING: The version of VMware Tools on VM 'CZSMJ-CZDT' is out of date and may c

ause Invoke-VMScript to work improperly.

ScriptOutput

-------------------------------------------------------------------------------

----------------------------------------|  The requested operation requires

elevation (Run as administrator).

-------------------------------------------------------------------------------

----------------------------------------

getting this error, any help on this.

i am writing this for windows 7 VMs Smiley Happy

Regards, Satheesh
0 Kudos
6 Replies
LucD
Leadership
Leadership

Is UAC enabled on that station?


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

0 Kudos
satheeshsatz
Enthusiast
Enthusiast

i have disabled now and trying to do, will keep post

Regards, Satheesh
0 Kudos
satheeshsatz
Enthusiast
Enthusiast

now i am getting error as below

ScriptOutput

-------------------------------------------------------------------------------

----------------------------------------|  Element not found.

-------------------------------------------------------------------------------

----------------------------------------

Regards, Satheesh
0 Kudos
LucD
Leadership
Leadership

"Element not found" is an error message from netsh.
So the command is working, but your parameters are obviously not correct.


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

0 Kudos
satheeshsatz
Enthusiast
Enthusiast

yes your correct, LAN is not correct.

now its working after we disable it.

but by default UAC wont be enabled state, is it possible to disable it via invoke-vmscript?

Regards, Satheesh
0 Kudos
LucD
Leadership
Leadership

0 Kudos