I was using the Invoke-VMScript Command to run a bat file on my VM from my local machine.
when i run it on a Win7 machine, loaded with vsphereclient UI software v4.1, PowerCLI installs v4.1 and VIX v1.10.2 the commands runs well
$batfile = '"C:\Files\batchfiles\BatchFile1.bat"'
Invoke-VMScript -VM $VMName -ScriptText $batfile -GuestUser Administrator -GuestPassword password -ScriptType bat
the output is perfect as expected.
however when i run this cmdlet on a Win2003 machine, on which i installed only PowerCLI installs v4.1 and VIX v1.10.2. I get the error as shown in the image attached.
Any suggestions how to solve this?
You cannot specify the ESX, while calling Invoke-VMScript, it's retrieved from the VM automatically.
Muhammed, did you try those things I asked you to. I need to know, in order to fail a bug, if such exists.
I did try the steps suggested by you. Uninstalled VMWare tools on both my VM as well as my PC. Installed PCLI tools as well as VsphereClient on all.
This did not solve the error which was coming before
"There was an error in communication"
This morning, in my Win2k3 PC, i modified the c:\windows\system32\drivers\etc\hosts file and added the IP of my VM on which i intend to run the bat files.
That got it running. No change in my old commands atall.
(however i still get the warning message about the version of VIX not being the same, inspite of using the same .exe file for installation on the VM as well as the PC)
Alex, you were mentioning about giving the hostuser and hostpassword, but as per VMware docs, for PCLIv4.1 and above, it mentions that those details are not required.
Thanks Pavel, Alex, LucD for your feedback..
p.s. Pavel as for the logging of the bug, the error is consistantly occuring if i dont add the IP of my VM in c:\windows\system32\drivers\etc\hosts file
I am happy that it worked for you, but still it seems strange to me. The VIX communicates with the VM on which the script is executed via the ESX. And if there's problem with the DNS, placing the ESX in the ...\etc\hosts may solve it, but the VM itself - I doubt ... Anyway it seems that the error message was OK.