$netshDNS2 = "C:\windows\system32\netsh.exe interface ip add dns $NetworkAdapter $DNS2 index=2"
Invoke-VMScript –VM $GuestVMname -guestuser $GuestUsername -guestpassword $GuestUserpwd -ScriptType bat -ScriptText $netshDNS2
In the above script the -guestuser (user name) is the administrator privileged user(the user is in the local administrator Group).
But i getting the error "the requested operation requires elevation (run as administrator)"
we are not able to use build-in administrator account.
Please help on the issue
The script you are launching is run under the VMware Tools service, hence the message.
There are a number of ways to run the script in elevated mode in this community.
Did you do a search?