Running scripts

Running scripts

To automate management of Virtual Server 2005, you can run scripts that use the Virtual Server COM interface. Scripts can use any scripting language that is capable of connecting to COM automation objects.

From the Administration Website, you can also configure scripts to run when certain Virtual Server or virtual machine events occur. For more information, see Configuring Virtual Server scripts.

Scripts are executed with Windows Script Host, the standard Windows® operating system scripting environment. You can use any script program that Windows Script Host is capable of executing by using the following syntax: script_program script_name. For example, you can run a script named myscript.vbs by using CScript, the command-line version of Windows Script Host, as follows:

cscript myscript.vbs

Scripts are executed in a new process in the system logon session, or the logon session of the user account under which the Virtual Server service is running. As a result, any user interface (UI) that the script attempts to present will not be visible on the local computer. In general, you should not attempt to display UI from scripts.

For more information about the scripting languages that you can use for Virtual Server scripts, see Virtual Server scripting support. For more information about developing your own scripts, see Developing custom scripts. For more information about the Virtual Server COM interface, see the Virtual Server 2005 Programmer's Guide, which you can find on the Start menu by pointing to All Programs and then Microsoft Virtual Server.