VMware Cloud Community
Muhammedali
Contributor
Contributor

Invoke-VMScript error on Win2003 machin

Hi,

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?

Tags (1)
Reply
0 Kudos
25 Replies
Muhammedali
Contributor
Contributor

Hi Alex,

In one of your previous post , you mentioned about giving the IP of the VM or ESX host? where excatly (in which parameter) do i have to giv this?

Reply
0 Kudos
alefestaedist
Hot Shot
Hot Shot

Just change the name of your VC/ESX with the IP...same parameter

Alex

Reply
0 Kudos
Pavel_Dimitrov
VMware Employee
VMware Employee

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.

Thanks,

Pavel

Reply
0 Kudos
alefestaedist
Hot Shot
Hot Shot

oppss.. thank Pavel.. sorry guys..

Alex

Reply
0 Kudos
Muhammedali
Contributor
Contributor

Hi Pavel,

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

Muhammedali

Reply
0 Kudos
Pavel_Dimitrov
VMware Employee
VMware Employee

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.

Regards,

Pavel

Reply
0 Kudos