Script: Generate a list of virtual machines

These two scripts from John Kelbley, written in VBScript, list the virtual machines that are currently registered on a given instance of Virtual Server. Remember that these scripts are provided as-is, with no warranties, and are not supported by Microsoft.

This script shows the virtual machines registered on the current instance of Virtual Server:

Set vpcApp = CreateObject("VirtualServer.Application")

Set vmCollection = vpcApp.VirtualMachines

For each vm in vmCollection
 Wscript.Echo vm.Name

Next

This script shows the virtual machines registered on a remote instance of Virtual Server:

Set vpcApp = CreateObject("VirtualServer.Application“,_ “\\remoteServer”)

Set vmCollection = vpcApp.VirtualMachines

For each vm in vmCollection
 Wscript.Echo vm.Name

Next