VMWare GSX comes with a VmCom and VmPerl scripting API to script actions you need to perform on GSX. You can use the scripting API to get a list of all registered VMs, get their execution state, get configuration parameters and so on.
I needed a script to disconnect all floppies and cd-roms from all virtual machines on a server. The scripting API makes this simple.
Check the attached file for a sample Perl script that does the trick. It is best to add the directory where VMWare GSX installed Perl to your path. Normally, Perl is installed in C:\Program Files\VMware\VMware VmPerl Scripting API. You should also connect the .pl extension to C:\Program Files\VMware\VMware VmPerl Scripting API\perl.exe.
To run the script (after path change and .pl extension), just type disconnect.pl from the command prompt.
Of course, you can create a similar script with VBScript or JScript but what's the fun in that. ![]()



