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
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:
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:
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.
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".
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.