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 = "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
- Search for the TODO text string in the sample code, and then
modify the sample code for your environment.
- Run the code.