Script: Show the state of all virtual machines


Here's another script from John Kelbley, written in VBScript. It shows the current state of all virtual machines on the current instance of Virtual Server. Remember that this script is provided as-is, with no warranties, and is not supported by Microsoft.



VMStateCodes = Array("Invalid", "Turned Off", "Saved",_  "Turning On",  "Restoring", "Running", "Paused", _  "Saving","Turning Off", "Merging Drives", _
  "Deleting Machine")


Set vpcApp = WScript.CreateObject("VirtualServer.Application")
Set vmCollection = vpcApp.VirtualMachines


'start up all saved state VMs
For each vm in vmCollection
 Wscript.Echo "      " & VMStateCodes(vm.State)
Next

Skip to main content