How to determine if an Exchange Server is a front-end server or a back-end server (322887)



The information in this article applies to:

  • Microsoft Exchange 2000 Server
  • Microsoft Exchange Server 2003 Enterprise Edition
  • Microsoft Active Directory Services Interface, System Component
  • Microsoft Active Directory Services Interface, Microsoft Active Directory Client
  • Microsoft Collaboration Data Objects for Exchange Management (CDOEXM)

This article was previously published under Q322887

INTRODUCTION

This article describes how to programmatically determine if a Microsoft Exchange Server is configured as a front-end server or as a back-end server.

MORE INFORMATION

The following sample code uses the Microsoft Collaboration Data Objects for Exchange Management (CDOEXM) IExchangeServer interface to determine if an Exchange Server is configured as a front-end server or as a back-end server. This sample code must be run on a computer that has the Exchange System Manager (ESM) tools installed. If the Exchange Server is not configured with either a front-end configuration or a back-end configuration, this sample code treats the Exchange Server as a back-end server.
  1. Create a .vbs file
  2. Paste the following code in the .vbs file:
    'TODO: Set the following strings to reflect your environment:
    SERVERNAME = "MyServer"
    OrganizationName = "MyExchangeOrganization"
    DomainName="MyDomain"
    UpperLevelDomain = "MyUpperLevelDomain"
    
    Set obj = CreateObject("CDOEXM.ExchangeServer")
    
    obj.datasource.open ("LDAP://" & SERVERNAME & "/CN=" & SERVERNAME &_
    ",CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN="&_ 
    OrganizationName &",CN=Microsoft Exchange,CN=Services, CN=Configuration,DC="&_ 
    DomainName&",DC=" & UpperLevelDomain)  
    
    If (obj.servertype = 0) Then
        msgbox obj.name & " is a back-end Exchange Server or is not configured as a front-end server or as a back-end server."  
    Else   
        msgbox obj.name & " is a front-end Exchange Server."  
    End If
    
  3. Search for the TODO text string in the sample code, and then modify the sample code for your environment.
  4. Run the code.

REFERENCES

For additional information about the IExchangeServer interface, visit the following Microsoft Developer Network (MSDN) Web site:

Modification Type:MajorLast Reviewed:5/7/2004
Keywords:kbhowto KB322887 kbAudDeveloper