(view source code of vmlist.vbs as plain text)
On Error Resume Next
Set virtualServer = CreateObject( "VirtualServer.Application" )
If Err Then Syntax( )
strMsg = ""
For Each objVM In virtualServer.VirtualMachines
strMsg = strMsg & "VM file name : " & objVM.File & vbCrLf
For Each objVhd In objVM.HardDiskConnections
strMsg = strMsg & "Virtual harddisk : " & objVHD.HardDisk.File & vbCrLf
strMsg = strMsg & "Undo harddisk : " & objVHD.undoHardDisk.File & vbCrLf
Next
strMsg = strMsg & "VM status : " & objVM.State & vbCrLf & vbCrLf & vbCrLf
Next
WScript.Echo strMsg
Sub Syntax( )
strMsg = vbCrLf & "VMList.vbs, Version 1.00" & vbCrLf _
& "List all Virtual Machines and their associated" & vbCrLf _
& "files on the local Virtual Server Host" & vbCrLf & vbCrLf _
& "Usage: CSCRIPT VMLIST.VBS" & vbCrLf & vbCrLf _
& "Written by Rob van der Woude" & vbCrLf _
& "http://www.robvanderwoude.com" & vbCrLf
WScript.Echo strMsg
WScript.Quit 1
End Sub
page last modified: 2024-04-16; loaded in 0.0103 seconds