Export (0) Print
Expand All

State Property

Exchange Server 2003

State Property

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The State property specifies the current state of the cluster resource. The State property is read-only.

Applies To

The State property is a member of the ExchangeClusterResource Class.

Instance Path

The State property appears on instances of the \\COMPUTERNAME\ROOT\cimv2\applications\exchange:ExchangeClusterResource class.

MOF Syntax

uint32 State;

Qualifiers

This property has no qualifiers.

Remarks

The State property possible values are the same as those returned by the GetClusterResourceState function. For more information about Microsoft Windows Clustering technologies, see the MSDN Web site Online link.

VBScript Example

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

'===============================================================
' Name:      ShowClusterResource_State
' Purpose:   Display each Cluster member found for Exchange server,
'            and show the State property on the
'            ExchangeClusterResource objects
' Input:     strComputerName [string] the computer to access
' Output:    Displays the name of each Connector and the
'            State property
'===============================================================
Public Sub ShowClusterResource_State ( 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 State property.
     WScript.echo "    State = [" & _
       TypeName(objExchangeConnector.VirtualMachine) & "] " & _
      objExchangeConnector.VirtualMachine
     '
     ' 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

Show:
© 2014 Microsoft