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.

Namespace

\\COMPUTERNAME\ROOT\MicrosoftExchangeV2:Exchange_Server

Provider

The ExchangeServerProvider supplies instances of the Exchange_Server class.

Origin

The Exchange_Server class extends the CIM_LogicalElement class.

Qualifiers

dynamic

Properties

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
[read,
 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
[read,
 write,
 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
[read,
 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
[read,
 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
[read,
 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
[read,
 Values{"Standard", "Enterprise",
   "Conferencing"},
 ValueMap{"0", "1", "2"}] uint8 Type;

The Type property indicates the server type.

Methods

Method Description
EnableMessageTracking Method
[implemented] void EnableMessageTracking(
  [IN] boolean MessageTrackingEnabled, 
  [IN,
   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, 
  [IN,
   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.

Associations

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}!//"& _
cComputerName&"/"&cWMINameSpace
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."
Else
  '
  ' 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
   Wscript.Echo""
   Wscript.Echo""
       '
       ' Display the value of the AdministrativeGroup property.
       WScript.echo "AdministrativeGroup      = "& _
        " ["&TypeName(objExchange_Server.AdministrativeGroup)&"] "& _
       objExchange_Server.AdministrativeGroup
       '
       '
       ' Display the value of the AdministrativeNote property.
       WScript.echo "AdministrativeNote       = "& _
        " ["&TypeName(objExchange_Server.AdministrativeNote)&"] "& _
       objExchange_Server.AdministrativeNote
       '
       '
       ' Display the value of the CreationTime property.
       WScript.echo "CreationTime             = "& _
        " ["&TypeName(objExchange_Server.CreationTime)&"] "& _
       objExchange_Server.CreationTime
       '
       '
       ' Display the value of the DN property.
       WScript.echo "DN                       = "& _
        " ["&TypeName(objExchange_Server.DN)&"] "& _
       objExchange_Server.DN
       '
       '
       ' Display the value of the ExchangeVersion property.
       WScript.echo "ExchangeVersion          = "& _
        " ["&TypeName(objExchange_Server.ExchangeVersion)&"] "& _
       objExchange_Server.ExchangeVersion
       '
       '
       ' Display the value of the FQDN property.
       WScript.echo "FQDN                     = "& _
        " ["&TypeName(objExchange_Server.FQDN)&"] "& _
       objExchange_Server.FQDN
       '
       '
       ' Display the value of the GUID property.
       WScript.echo "GUID                     = "& _
        " ["&TypeName(objExchange_Server.GUID)&"] "& _
       objExchange_Server.GUID
       '
       '
       ' Display the value of the IsFrontEndServer property.
       WScript.echo "IsFrontEndServer         = "& _
        " ["&TypeName(objExchange_Server.IsFrontEndServer)&"] "& _
       objExchange_Server.IsFrontEndServer
       '
       '
       ' Display the value of the LastModificationTime property.
       WScript.echo "LastModificationTime     = "& _
        " ["&TypeName(objExchange_Server.LastModificationTime)&"] "& _
       objExchange_Server.LastModificationTime
       '
       '
       ' Display the value of the MessageTrackingEnabled property.
       WScript.echo "MessageTrackingEnabled   = "& _
        " ["&TypeName(objExchange_Server.MessageTrackingEnabled)&"] "& _
       objExchange_Server.MessageTrackingEnabled
       '
       '
       ' Display the value of the MessageTrackingLogFileLifetime property.
       WScript.echo "MessageTrackingLogFileLifetime= "& _
        " ["&TypeName(objExchange_Server.MessageTrackingLogFileLifetime)&"] "& _
       objExchange_Server.MessageTrackingLogFileLifetime
       '
       '
       ' Display the value of the MessageTrackingLogFilePath property.
       WScript.echo "MessageTrackingLogFilePath= "& _
        " ["&TypeName(objExchange_Server.MessageTrackingLogFilePath)&"] "& _
       objExchange_Server.MessageTrackingLogFilePath
       '
       '
       ' Display the value of the MonitoringEnabled property.
       WScript.echo "MonitoringEnabled        = "& _
        " ["&TypeName(objExchange_Server.MonitoringEnabled)&"] "& _
       objExchange_Server.MonitoringEnabled
       '
       '
       ' Display the value of the MTADataPath property.
       WScript.echo "MTADataPath              = "& _
        " ["&TypeName(objExchange_Server.MTADataPath)&"] "& _
       objExchange_Server.MTADataPath
       '
       '
       ' Display the value of the Name property.
       WScript.echo "Name                     = "& _
        " ["&TypeName(objExchange_Server.Name)&"] "& _
       objExchange_Server.Name
       '
       '
       ' Display the value of the RoutingGroup property.
       WScript.echo "RoutingGroup             = "& _
        " ["&TypeName(objExchange_Server.RoutingGroup)&"] "& _
       objExchange_Server.RoutingGroup
       '
       '
       ' Display the value of the SubjectLoggingEnabled property.
       WScript.echo "SubjectLoggingEnabled    = "& _
        " ["&TypeName(objExchange_Server.SubjectLoggingEnabled)&"] "& _
       objExchange_Server.SubjectLoggingEnabled
       '
       '
       ' Display the value of the Type property.
       WScript.echo "Type                     = "& _
        " ["&TypeName(objExchange_Server.Type)&"] "& _
       objExchange_Server.Type
       '
    Next
  Else
    ' 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.