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


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

Problem

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

Solution

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. ' ------ SCRIPT CONFIGURATION ------ strComputer = "<Exchange Server>" 'e.g., ExchServer2 ' ------ END CONFIGURATION ---------     set objWMI = GetObject("winmgmts:\\" & strComputer & _                        "\root\MicrosoftExchangeV2")     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 "-----------" Next Wscript.Echo "Script completed successfully."

Discussion

Exchange is very dependent upon Active Directory domain controllers. The list of domain controllers currently being used by a server is usually one of the first pieces of information you should gather when you encounter an Exchange issue. While this can be done through the GUI, it is much easier to get the data through a script.

Unfortunately, you must have at least local administrator rights on the Exchange Server being queried to get this information.


While the GUI provides only a listing of the domain controllers and global catalog servers in use, the WMI provider offers considerably more information. This additional information can be extremely important during troubleshooting, so you should have this script or something similar available to your Exchange Admins for troubleshooting purposes.

Using VBScript

Because this script uses Exchange WMI extensions, it can be run from any machine that has WMI. The machine does not have to have the Exchange Management Tools loaded.


See Also

Exchange Server 2003 SDK: WMI Reference



Windows Server Cookbook
Windows Server Cookbook for Windows Server 2003 and Windows 2000
ISBN: 0596006330
EAN: 2147483647
Year: 2006
Pages: 380
Authors: Robbie Allen

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net