Exchange_Server Class

Exchange_Server Class

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.

Instances of the Exchange_Server WMI class provide properties and methods for working with Exchange servers.




The ExchangeServerProvider supplies instances of the Exchange_Server class.


The Exchange_Server class extends the CIM_LogicalElement class.




Property Description
FQDN Property
[key, read] string FQDN;

The FQDN property indicates the fully qualified domain name of the computer running Microsoft® Exchange server.

AdministrativeGroup Property
[read] string AdministrativeGroup;

The AdministrativeGroup property indicates the name of the Exchange 2000 administrator group to which the server belongs.

AdministrativeNote Property
 write] string AdministrativeNote;

The AdministrativeNote property specifies the administrative note for the server.

CreationTime Property
[read] datetime CreationTime;

The CreationTime property indicates when the Microsoft Active Directory® object was created.

DN Property
[read] string DN;

The DN property indicates the distinguished name attribute on the server object in Active Directory.

ExchangeVersion Property
[read] string ExchangeVersion;

The ExchangeVersion property indicates the product version information, including build and service pack number.

GUID Property
[read] string GUID;

The GUID property indicates the globally unique identifier (GUID) attribute of the server object in Active Directory.

IsFrontEndServer Property
[read] boolean IsFrontEndServer;

The IsFrontEndServer property indicates whether the server is a front-end server.

LastModificationTime Property
[read] datetime LastModificationTime;

The LastModificationTime property indicates when the Active Directory object was last modified.

MessageTrackingEnabled Property
[read] boolean MessageTrackingEnabled;

The MessageTrackingEnabled property indicates whether message tracking is enabled on the server.

MessageTrackingLogFileLifetime Property
 Units("days")] uint32 MessageTrackingLogFileLifetime;

The MessageTrackingLogFileLifetime property specifies how long message tracking logs are to be kept.

MessageTrackingLogFilePath Property
[read] string MessageTrackingLogFilePath;

The MessageTrackingLogFilePath property indicates the location where message tracking logs are stored.

MonitoringEnabled Property
 write] boolean MonitoringEnabled;

The MonitoringEnabled property specifies whether monitoring is enabled on the server.

MTADataPath Property
[read] string MTADataPath;

The MTADataPath property indicates the location of the MTA queue files.

Name Property
 Override("Name")] string Name = NULL;

The Name property indicates the Network Basic Input/Output System (NetBIOS) name of the computer running Exchange server.

RoutingGroup Property
[read] string RoutingGroup;

The RoutingGroup property indicates the name of the Exchange 2000 routing group to which the server belongs.

SubjectLoggingEnabled Property
 write] boolean SubjectLoggingEnabled;

The SubjectLoggingEnabled property controls whether message subjects are included in message tracking logs. It also controls whether subjects are displayed in the queue viewer.

Type Property
 Values{"Standard", "Enterprise",
 ValueMap{"0", "1", "2"}] uint8 Type;

The Type property indicates the server type.


Method Description
EnableMessageTracking Method
[implemented] void EnableMessageTracking(
  [IN] boolean MessageTrackingEnabled, 
   OPTIONAL] string MessageTrackingLogFilePath);

The EnableMessageTracking method controls whether Exchange records message transfers so that messages can be tracked.

MoveMTAData Method
[implemented] void MoveMTAData(
  [IN] string MTADataPath, 
   OPTIONAL] boolean StopOnError = TRUE);

The MoveMTAData method moves the MTA message queue files to a new directory. This does not move other MTA support files, only the queues.


This class has no associations.

VBScript Example

The following example shows how to retrieve a list of Exchange_Server instances, and how to retrieve all the associated properties.

' Purpose:   Display each Exchange_Server found for Exchange server,
'            and show all properties on the Exchange_Server
'            objects
' Change:    cComputerName [string] the computer to access
' Output:    Displays the name of each Exchange_Server and properties

On Error Resume Next
Dim cComputerName
Const cWMINameSpace = "root/MicrosoftExchangeV2"
Const cWMIInstance = "Exchange_Server"
cComputerName = "MyComputerNETBIOSName"

Dim strWinMgmts		' Connection string for WMI
Dim objWMIExchange	' Exchange Namespace WMI object
Dim listExchange_Servers	' ExchangeLogons collection
Dim objExchange_Server		' A single ExchangeLogon WMI object

' Create the object string, indicating WMI (winmgmts), using the
' current user credentials (impersonationLevel=impersonate),
' on the computer specified in the constant cComputerName, and
' using the CIM namespace for the Exchange provider.
strWinMgmts = "winmgmts:{impersonationLevel=impersonate}!//"& _
Set objWMIExchange =  GetObject(strWinMgmts)
' Verify we were able to correctly set the object.
If Err.Number <> 0 Then
  WScript.Echo "ERROR: Unable to connect to the WMI namespace."
  ' The Resources that currently exist appear as a list of
  ' Exchange_Server instances in the Exchange namespace.
  Set listExchange_Servers = objWMIExchange.InstancesOf(cWMIInstance)
  ' Were any Exchange_Server Instances returned?
  If (listExchange_Servers.count > 0) Then
    ' If yes, do the following:
    ' Iterate through the list of Exchange_Server objects.
    For Each objExchange_Server in listExchange_Servers
       ' Display the value of the AdministrativeGroup property.
       WScript.echo "AdministrativeGroup      = "& _
        " ["&TypeName(objExchange_Server.AdministrativeGroup)&"] "& _
       ' Display the value of the AdministrativeNote property.
       WScript.echo "AdministrativeNote       = "& _
        " ["&TypeName(objExchange_Server.AdministrativeNote)&"] "& _
       ' Display the value of the CreationTime property.
       WScript.echo "CreationTime             = "& _
        " ["&TypeName(objExchange_Server.CreationTime)&"] "& _
       ' Display the value of the DN property.
       WScript.echo "DN                       = "& _
        " ["&TypeName(objExchange_Server.DN)&"] "& _
       ' Display the value of the ExchangeVersion property.
       WScript.echo "ExchangeVersion          = "& _
        " ["&TypeName(objExchange_Server.ExchangeVersion)&"] "& _
       ' Display the value of the FQDN property.
       WScript.echo "FQDN                     = "& _
        " ["&TypeName(objExchange_Server.FQDN)&"] "& _
       ' Display the value of the GUID property.
       WScript.echo "GUID                     = "& _
        " ["&TypeName(objExchange_Server.GUID)&"] "& _
       ' Display the value of the IsFrontEndServer property.
       WScript.echo "IsFrontEndServer         = "& _
        " ["&TypeName(objExchange_Server.IsFrontEndServer)&"] "& _
       ' Display the value of the LastModificationTime property.
       WScript.echo "LastModificationTime     = "& _
        " ["&TypeName(objExchange_Server.LastModificationTime)&"] "& _
       ' Display the value of the MessageTrackingEnabled property.
       WScript.echo "MessageTrackingEnabled   = "& _
        " ["&TypeName(objExchange_Server.MessageTrackingEnabled)&"] "& _
       ' Display the value of the MessageTrackingLogFileLifetime property.
       WScript.echo "MessageTrackingLogFileLifetime= "& _
        " ["&TypeName(objExchange_Server.MessageTrackingLogFileLifetime)&"] "& _
       ' Display the value of the MessageTrackingLogFilePath property.
       WScript.echo "MessageTrackingLogFilePath= "& _
        " ["&TypeName(objExchange_Server.MessageTrackingLogFilePath)&"] "& _
       ' Display the value of the MonitoringEnabled property.
       WScript.echo "MonitoringEnabled        = "& _
        " ["&TypeName(objExchange_Server.MonitoringEnabled)&"] "& _
       ' Display the value of the MTADataPath property.
       WScript.echo "MTADataPath              = "& _
        " ["&TypeName(objExchange_Server.MTADataPath)&"] "& _
       ' Display the value of the Name property.
       WScript.echo "Name                     = "& _
        " ["&TypeName(objExchange_Server.Name)&"] "& _
       ' Display the value of the RoutingGroup property.
       WScript.echo "RoutingGroup             = "& _
        " ["&TypeName(objExchange_Server.RoutingGroup)&"] "& _
       ' Display the value of the SubjectLoggingEnabled property.
       WScript.echo "SubjectLoggingEnabled    = "& _
        " ["&TypeName(objExchange_Server.SubjectLoggingEnabled)&"] "& _
       ' Display the value of the Type property.
       WScript.echo "Type                     = "& _
        " ["&TypeName(objExchange_Server.Type)&"] "& _
    ' If no Exchange_Server instances were returned,
    ' display that.
    WScript.Echo "WARNING: No Exchange_Server instances were returned."
  End If
End If

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.