Automation

 View Only
  • 1.  Invoke-vmscript authentication failure

    Posted May 28, 2015 04:54 PM

    HI,

       Im facing an issue with the Invoke-VMscript command.The authentication is failing even though the credentials are correct. I couldnt find a proper reason for this failure.

    Is there any particular reason for this ?

    Thanks in advance



  • 2.  RE: Invoke-vmscript authentication failure

    Posted May 28, 2015 05:03 PM

    Try single quotes for the username and password.



  • 3.  RE: Invoke-vmscript authentication failure

    Posted May 29, 2015 09:59 AM

    It dint help. Is there any prerequisite to access the script in the guest vm ?



  • 4.  RE: Invoke-vmscript authentication failure

    Posted May 29, 2015 10:36 AM

    Please answer/review each of the following items:

    1. Are you trying to call a script that is stored locally on the target GuestOS, or stored locally on your PowerCLI machine?

    2. Can you execute single-commands? I.e. try -ScriptText 'ipconfig'

    3. Is the "vmadmin" account a domain or a local OS account? If a domain account, use "domain\vmadmin", if it's a local account, use ".\vmadmin"

    4. The vmadmin account MUST be in the local administrators group of the target Guest. Have you double-checked this?

    5. Can you logon with the vmadmin account to the GuestOS via RDP or locally and try some administrative task?

    6. Does the user account you run PowerCLI with have read access to the folder containing the virtual machine and  the Virtual Machine.Interaction.Console Interaction privilege?

    There are a couple of requirements you need to fulfill to use Invoke-VMScript. Check the documentation:

    http://pubs.vmware.com/vsphere-55/index.jsp?topic=%2Fcom.vmware.powercli.cmdletref.doc%2FInvoke-VMScript.html:

    To run Invoke-VMScript, the user must have read access to the folder containing the virtual machine and a Virtual Machine.Interaction.Console Interaction privilege. The virtual machines must be powered on and have VMware Tools installed. Network connectivity to the ESX system hosting the virtual machine on port 902 must be present. To authenticate with the host or the guest OS, one of the HostUser/HostPassword (GuestUser/GuestPassword) pair and HostCredential (GuestCredential) parameters must be provided. The guest account you use to authenticate with the guest operating system must have administrator's privileges.

    Also run this test script which will check some prerequisites:

    http://www.lucd.info/2012/01/01/will-invoke-vmscript-work/



  • 5.  RE: Invoke-vmscript authentication failure

    Posted May 29, 2015 12:05 PM

    I was able to run ipconfig command. I gave the same permission to vm.bat file as ipconfig.exe application. I was able to access ipconfig.exe, but not vm.bat file

    The path couldnt be found.



  • 6.  RE: Invoke-vmscript authentication failure

    Posted May 29, 2015 12:14 PM

    Good job ignoring most of the questions I specifically asked to go through.

    Anyways, I'm pretty sure it won't be able to find the path from your screenshot that is "c\x\vm.bat".



  • 7.  RE: Invoke-vmscript authentication failure

    Posted May 29, 2015 12:48 PM

    well, i have already checked all the prerequisite u ve mentioned.All these requirements are there in the VM. I just want to highlight that the ipconfig.exe is accessible,

    hence something else is needed to access the user created file like vm.bat.



  • 8.  RE: Invoke-vmscript authentication failure

    Posted May 29, 2015 01:58 PM

    You may be running something that requires permission elevation.  I've run into that many times.