共用方式為


IVMVirtualServer::VirtualNetworks property

The VirtualNetworks property contains a collection of IVMVirtualNetwork objects.

This property is read-only.

Syntax

HRESULT get_VirtualNetworks(
  [out] IVMVirtualNetworkCollection **virtualNetworkCollection
);

VB
VMVirtualServer.VirtualNetworks( _
  ByRef virtualNetworkCollection _
)

Property value

The VMVirtualNetworkCollection object associated with Virtual Server.

This property value is read-only.

Error codes

Name Meaning
S_OK
The operation was successful.
E_POINTER
virtualNetworkCollection is NULL.
DISP_E_EXCEPTION
An unexpected error occurred.

Examples

The following example displays properties of the VMVirtualNetworkCollection object in the VirtualNetworks property value of the VMVirtualServer object.

Set objVS = CreateObject("VirtualServer.Application")
Wscript.Echo "Name: " & objVS.Name

Set objVNColl = objVS.VirtualNetworks
If objVNColl.Count = 0 Then
  Wscript.Echo "Virtual networks: [none]"
Else
  Wscript.Echo "Virtual networks: " & objVNColl.Count
  For Each objVN in objVNColl
    Wscript.Echo "    Name: " & objVN.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
VsComInterfaces.h

See also

IVMVirtualServer