The VirtualMachines property contains a collection of IVMVirtualMachine objects.
This property is read-only.
Syntax
HRESULT get_VirtualMachines(
  [out] IVMVirtualMachineCollection **virtualMachineCollection
);
| VB | 
|---|
 | 
Property value
The IVMVirtualMachineCollection object associated with Virtual Server.
This property value is read-only.
Error codes
| Name | Meaning | 
|---|---|
  | 
The operation was successful. | 
  | 
virtualMachineCollection is NULL. | 
  | 
An unexpected error occurred. | 
Examples
The following example displays properties of the VirtualMachines object associated with the VMVirtualServer object.
Set objVS = CreateObject("VirtualServer.Application")
Wscript.Echo "Name: " & objVS.Name
Set objVMColl = objVS.VirtualMachines
If objVMColl.Count = 0 Then
  Wscript.Echo "    Virtual machines: [none]"
Else
  Wscript.Echo "Virtual machines: " & objVMColl.Count
  For Each objVM in objVMColl
    Wscript.Echo "    Name: " & objVM.Name
  Next
End If
Requirements
| Product | 
Microsoft Virtual Server 2005 onWindows Server 2003 | 
| Download | 
Microsoft Virtual Server 2005 R2 SP1 Update onWindows Server 2008orWindows Server 2003 | 
| Header | 
  |