17.26. Listing Domain Controllers and Global Catalog Servers Used by an Exchange Server


You want to list the domain controllers and global catalog servers currently being used by an Exchange Server.


Using a graphical user interface

  1. Open the Exchange System Manager (ESM) snap-in.

  2. In the left pane, browse to the Servers container.

  3. Right-click on the target server and select Properties.

  4. Click on the Directory Access tab and view the domain controllers being used.

Using VBScript

' This code enumerates domain controllers being used.
strComputer = "<Exchange Server>" 'e.g., ExchServer2
' ------ END CONFIGURATION ---------
set objWMI = GetObject("winmgmts:\\" & strComputer & _
set objDCList = objWMI.ExecQuery("Select * from Exchange_DSAccessDC",,48)
for each objDc in objDCList
  Wscript.Echo "DCName: objDc.name"
  strTemp = "Automatic"
  if (dc.ConfigurationType=0) then strTemp="Manual" 
  Wscript.Echo "  Selection: " & strTemp
  Wscript.Echo "  Is Fast  : " & objDc.IsFast
  Wscript.Echo "  In Sync  : " & objDc.IsInSync
  Wscript.Echo "  Is Up    : " & objDc.IsUp
  Wscript.Echo "  Ldap Port: " & objDc.LDAPPort
  strTemp = "Global Catalog"
  if (objDc.type=0) then strTemp = "Config"
  if (objDc.type=1) then strTemp = "Local Domain"
  Wscript.Echo "  Role     : " & strTemp
  Wscript.Echo "-----------"
Wscript.Echo "Script completed successfully."


Exchange is very dependent upon Active Directory domain controllers. The list of domain controllers ...

Get Windows Server Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.