Microsoft KB Archive/322887

= How to determine if an Exchange Server is a front-end server or a back-end server =

Article ID: 322887

Article Last Modified on 10/25/2007

-

APPLIES TO


 * Microsoft Exchange 2000 Server Standard Edition
 * Microsoft Exchange Server 2003 Enterprise Edition
 * Microsoft Active Directory Service Interfaces 2.5
 * Microsoft Active Directory Service Interfaces 2.5
 * Microsoft Collaboration Data Objects for Exchange Management 1.1

-



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.  Create a .vbs file  Paste the following code in the .vbs file: 'TODO: Set the following strings to reflect your environment: SERVERNAME = &quot;MyServer&quot; OrganizationName = &quot;MyExchangeOrganization&quot; DomainName=&quot;MyDomain&quot; UpperLevelDomain = &quot;MyUpperLevelDomain&quot;

Set obj = CreateObject(&quot;CDOEXM.ExchangeServer&quot;)

obj.datasource.open (&quot;LDAP://&quot; & SERVERNAME & &quot;/CN=&quot; & SERVERNAME &_ &quot;,CN=Servers,CN=First Administrative Group,CN=Administrative Groups,CN=&quot;&_ OrganizationName &&quot;,CN=Microsoft Exchange,CN=Services, CN=Configuration,DC=&quot;&_ DomainName&&quot;,DC=&quot; & UpperLevelDomain)

If (obj.servertype = 0) Then msgbox obj.name & &quot; is a back-end Exchange Server or is not configured as a front-end server or as a back-end server.&quot; Else msgbox obj.name & &quot; is a front-end Exchange Server.&quot; End If  Search for the TODO text string in the sample code, and then modify the sample code for your environment. Run the code.

