I don't think this has anything to do with PowerCLI nor with the vSphere version.
Looks like the Rename-NetAdapter cmdlet has a problem.
Can you run the code in the guest OS itself from a PS prompt?
Make sure to logon with the same account you used for the Invoke-VMScript cmdlet.Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
I was able to run this command in the guest OS from PS with the same account.
I was also receiving this error on other cmdlets besides Rename-NetAdapter.
Thanks for the timely reply!
Anything in the eventlogs that gives more info on what the error might be?Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
I looked in the PowerShell Event log with the Get-EventLog -LogName 'Windows PowerShell' cmdlet and also looked through the computer event log. Nothing stood out as being relevant to the problem I was having. There were no errors in the PowerShell log, only warnings that said the following:
"The specified mount name 'vmstores' is already in use"
"The specified mount name 'vis' is already in use"
"Attempting to perform the NewDrive operation on the 'VimInventory' provider fail..."
The computer event log had no warnings or errors.
If neither of these is the right eventlog you were referring to, could you please be more specific?
No specific eventlog intended, just in general.
On another note, the messages that registry entries were marked for deletion.
Did you reboot the VM, and do still get the same error after that?Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz