Automation

 View Only
  • 1.  Invoke-VMScript failing with local admin id

    Posted Apr 11, 2018 06:48 PM

    Hi,

    I'm trying to run a netsh interface command from another server using Invoke-VMScript. I am using the local administrator and pwd on a Windows server.

    I am getting the error:

    Failed to authenticate with the guest operating system using the supplied credentials.

    For example, this does not even work:

    Invoke-VMScript -ScriptText 'netsh interface ip show addresses' -VM $vm -GuestUser $Adminname -GuestPassword $Adminpassword -ScriptType bat

    Thanks for any help!



  • 2.  RE: Invoke-VMScript failing with local admin id
    Best Answer

    Posted Apr 11, 2018 07:15 PM

    The error message is quite clear it seems.

    You might review what you have in the variables $AdminName and $AdminPassword.

    Can you logon with the values in those variables to the guest OS?

    What kind of guest OS is running in the VM?

    Which PowerCLI version are you using?



  • 3.  RE: Invoke-VMScript failing with local admin id

    Posted Apr 11, 2018 08:50 PM

    Hello,

    Assuming the variables are all good and you are running a Windows VM. It could also be related to the current UAC settings. See if the article below helps you.

    Ref:

    https://support.na.sage.com/selfservice/viewContent.do?externalId=10198&sliceId=1



  • 4.  RE: Invoke-VMScript failing with local admin id

    Posted Apr 11, 2018 09:23 PM

    Afaik UAC issues will give you an "Access Denied" from inside the guest OS, the infamous xx5 error codes, on the command/script you are running.
    The error mentioned in this thread occurs earlier, when the GuestAuthManager tries to logon to the guest OS.



  • 5.  RE: Invoke-VMScript failing with local admin id

    Posted Apr 12, 2018 07:28 PM

    Thanks All - it was running the script against a variable which had an incorrect server name in it :smileyblush:

    Sorry for the waste of your time!

    Thanks