ExchangeClusterResource Class

The ExchangeClusterResource WMI class has properties that return information about a Microsoft® Exchange cluster resource.

Namespace

\\COMPUTERNAME\ROOT\cimv2\applications\exchange:ExchangeClusterResource

Provider

The ExchangeClusterProvider supplies instances of the ExchangeClusterResource class.

Origin

The ExchangeClusterResource class does not extend any other class.

Qualifiers

dynamic

Properties

PropertyDescription
Name Property
[key] string Name;

The Name property returns the name of the Exchange cluster resource.

VirtualMachine Property
[key] string VirtualMachine;

The VirtualMachine property returns the name of the virtual machine that owns this resource.

Owner Property
string Owner;

The Owner property for a cluster resource specifies the cluster node of which the resource is a part.

State Property
uint32 State;

The State property specifies the current state of the cluster resource.

Type Property
string Type;

The Type property specifies the resource type.

Methods

This class has no methods.

Remarks

For more information about Microsoft Windows® Clustering technologies, see the MSDN Web site Online link.

Associations

This class has no associations.

VBScript Example

The following example shows how to retrieve a list of ExchangeClusterResource instances on the specified Exchange server, and how to retrieve the properties on each ExchangeClusterResource instance.

'===============================================================
' Name:      ShowClusterResource_AllProperties
' Purpose:   Display each Cluster member found for Exchange server,
'            and show all properties on the ExchangeClusterResource
'            objects
' Input:     strComputerName [string] the computer to access
' Output:    Displays the name of each Connector and properties
'===============================================================
Public Sub ShowClusterResource_AllProperties ( strComputerName )

Const cWMINameSpace = "root/cimv2/applications/exchange"
Const cWMIInstance = "ExchangeClusterResource"

Dim strWinMgmts              ' Connection string for WMI
Dim objWMIExchange           ' Exchange Namespace WMI object
Dim listClusterResources     ' ExchangeClusterResource collection
Dim objExchangeConnector     ' A single ExchangeClusterResource WMI object

' Create the object string, indicating WMI (winmgmts), using the
' current user credentials (impersonationLevel=impersonate),
' on the computer passed to the function in strComputerName, and
' using the CIM namespace for the Exchange provider.
strWinMgmts = "winmgmts:{impersonationLevel=impersonate}!//" & _
   strComputerName & "/" & cWMINameSpace
'
' Get an object using the string you just created.
Set objWMIExchange =  GetObject(strWinMgmts)
'
' The Resources that currently exist appear as a list of
' ExchangeClusterResource instances in the Exchange namespace.
Set listClusterResources = objWMIExchange.InstancesOf(cWMIInstance)
'
' Were any ExchangeClusterResource Instances returned?
if (listClusterResources.count > 0) then
  ' If yes, do the following:
  ' Iterate through the list of ExchangeClusterResource objects.
  For each objExchangeConnector in listClusterResources
     '
     ' Display the value of the Name property.
     WScript.echo "Name = " & _
      "[" & TypeName(objExchangeConnector.Name) & "] " & _
       objExchangeConnector.Name
     '
     ' Display the value of the VirtualMachine property.
     WScript.echo "    VirtualMachine = [" & _
       TypeName(objExchangeConnector.VirtualMachine) & "] " & _
      objExchangeConnector.VirtualMachine
     '
     ' Display the value of the Owner property.
     WScript.echo "    Owner          = " & _
      "[" & TypeName(objExchangeConnector.Owner) & "] " & _
       objExchangeConnector.Owner
     '
     ' Display the value of the State property.
     WScript.echo "    State          = " & _
      "[" & TypeName(objExchangeConnector.State) & "] " & _
       objExchangeConnector.State
     '
     ' Display the value of the Type property.
     WScript.echo "    Type           = " & _
      "[" & TypeName(objExchangeConnector.Type) & "] " & _
       objExchangeConnector.Type
     '
     ' Move to the next ExchangeClusterResource.
  Next
else
  ' If no ExchangeClusterResource instances were returned,
  ' display that.
  WScript.Echo "No ExchangeClusterResource instances were returned."
end if
end Sub

Page view tracker