how do i send a script to plink for a SSH connection to ESX 4

We have 3 ESX hosts, which i need to SSH into and send a script to automatically start a server.

i have created the Shell user, and can open a plink session to the host using the shell user,
i can also manually type the commands into the session and have the session perform the command, which is:
vmware-cmd -i
then listvms, or start server

now i want to do this automatically, but i havent been able to get it working.
probably cos i dont know what i am doing...lol

i created a txt file with vmware-cmd -i and listvms on 2 lines, to test but doesnt work using
plink -ssh 192.168.10.61 -l USER -pw PASS -m list.txt

any ideas or how comments on how i should do this
jcmurphy777Asked:
Who is Participating?
 
za_mkhConnect With a Mentor Commented:
0
 
jcmurphy777Author Commented:
that is awesome!!!

done so many search's but to noavail,

thanks for the find.

so for everyone who might find this, in the file, you need to reference the vmware commands in directory format, according to the link za-mkh wrote above.

for example, to stop a vm, include in the command file:
/usr/bin/vmware-cmd -i /vmfs/volumes/DataStoreName/VMName/VMName.vmx stop


i found a website with vmware script for the vmware-cmd

http://steveswanson.wordpress.com/category/scripting/esx-scripting/

i will test the scripting and post the full command line. will be a few weeks though. holidays...

thanks again za_mkh
0
 
za_mkhCommented:
Thanks for the lesson jcmurphy77. We all learn new things everyday!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.