$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
Is UAC enabled on that station?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
i have disabled now and trying to do, will keep post
now i am getting error as below
ScriptOutput
-------------------------------------------------------------------------------
----------------------------------------| Element not found.
|
|
|
-------------------------------------------------------------------------------
----------------------------------------
"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
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?
Have a look at Re: Invoke-VMScript to run ps commands as an administrator
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference