Recipe3.1.Determining Which Domain Controllers Exchange Is Using


Recipe 3.1. Determining Which Domain Controllers Exchange Is Using

Problem

You need to know which DCs and GCs your Exchange server is currently configured to use, and whether they have been manually assigned or auto-discovered.

Solution

Using a graphical user interface

  1. Launch the Exchange System Manager (Exchange System Manager.msc).

  2. In the left pane, expand the appropriate Administrative Groups container, and then expand the Servers container.

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

  4. Select the Directory Access tab. This tab will be present if you are using Exchange 2000 SP2 or later.

  5. By default, all DCs that this server can use are shown, regardless of their role. You can determine their role by looking at the Type field.

  6. If you need to limit the display to just a single type, select the appropriate option from the Show combo box. You can show All Domain Controllers, Configuration Domain Controller, Domain Controllers, or Global Catalog Servers.

Using VBScript
' This code queries the list of DSAccess instances and  ' reports which DCs DSAccess is using. ' ------ SCRIPT CONFIGURATION ------ strServer = "<ServerFQDN>"  ' e.g., xch01.foobar.com; the NetBIOS name works too ' ------ END CONFIGURATION --------- Dim objWMIExch Dim listDCInst Dim objDCInst Dim strDCInfo ' Get the Exchange Namespace WMI object Set objWMIExch =  GetObject("winmgmts:{impersonationLevel=impersonate}!//" &_   strServer & "/root/MicrosoftExchangeV2") ' Get the list of Exchange_DSAccessDC instances and iterate through them ' to display their properties Set listDCInst = objWMIExch.InstancesOf("Exchange_DSAccessDC") strDCInfo = "" For each objDCInst in listDCInst    strDCInfo = strDCInfo & "DC: " & objDCInst.Name & " ("    Select Case objDCInst.Type      Case 0 strDCInfo = strDCInfo & "Configuration DC)"      Case 1 strDCInfo = strDCInfo & "Domain Controller)"      Case 2 strDCInfo = strDCInfo & "Global Catalog)"    End Select    Select Case objDCInst.ConfigurationType      Case 0 strDCInfo = strDCInfo & " is manually configured."      Case 1 strDCInfo = strDCInfo & " was auto-discovered."    End Select    strDCInfo = strDCInfo & VbCrLF Next Wscript.Echo strDCInfo

Discussion

The GUI method is straightforward if you are running at least Exchange 2000 SP2. Frankly, if you are still running SP1 or original Exchange 2000, you have bigger problems to worry about. Still, you can find at least a small bit of the information by looking at the field labeled Domain controller used by services on this server on the General tab of the server properties dialog in ESM.

It is normal to see multiple DC instances; at a minimum, you're going to have three: one for the configuration DC, one for the DC role, and one for the GC role. The additional instances are used for redundancy and failover. DSAccess will allow only one configuration DC instance, to minimize update issues caused by replication latency in Active Directory's multi-master architecture.

On a machine that is both a DC and Exchange server, you will only see three entries no matter how many other DCs you may have deployed; they will all be the local machine (see Recipe 2.9). This is because when you combine these roles, Exchange makes the optimization decision that you probably only have one DC (as when you're running Small Business Server)a reasonable decision in most cases.

Using VBScript

The VBScript solution uses the Exchange WMI namespace and relies on the Exchange_DSAccess class, which was added in Exchange 2000 SP2. If your server is not at least running at that build, the DSADiag utility is going to be your only option; you can get it from Microsoft's Product Support Services (PSS) organization.

By default, this script runs under the credentials of the current user, so you must run it as a user with Exchange administrative privileges.


The basic technique we used is to retrieve a collection of Exchange_DSAccessDC objects, since each configured or discovered DC instance will be a separate entry. The Name property is a string with the FQDN of the DC configured for that instance, while the Type and ConfigurationType properties tell you what type of instance this is and whether it was auto-discovered or manually configured. Note that the ConfigurationType property is read-only, while both Name and Type are read/write. If you're creating new instances of Exchange_DSAccessDC, you have to specify a name and type when you create them.

Additional properties that weren't included in the solution, but may be of interest to you, include:


IsUp

A read-only Boolean property. It is set to true if the DC instance responded the last time that Exchange attempted to access it.


IsFast

A read-only Boolean property. It is set to true if the DC instance has responded within two seconds to the last request from this instance of DSAccess.


IsInSync

A read-only Boolean property. It is set to true if the DC instance is fully synchronized with the GC and Configuration DCs.


LDAPPort

A 32-bit unsigned integer. It indicates which destination port Exchange will use to communicate with the DC; it's read/write, so you can set it to force LDAP to use an alternate port (though this is of little value since Active Directory services always run on their default ports).

See Also

Recipe 2.8 for more on installing Exchange on a DC, Recipe 3.2 for more on forcing Exchange to use specified DCs, Recipe 3.3 and Recipe 3.4 for more on verifying which DCs and GCs are in use, and Recipe 3.8 for troubleshooting the DSAccess discovery process; the Understanding and Troubleshooting Directory Access Microsoft white paper, Chapter 3 of the Exchange Server 2003 Technical Reference Guide, and MS KB 316300 (Event ID 2080 from MSExchangeDSAccess); MSDN documentation for the Exchange_DSAccessDC class



Exchange Server Cookbook
Exchange Server Cookbook: For Exchange Server 2003 and Exchange 2000 Server
ISBN: 0596007175
EAN: 2147483647
Year: 2006
Pages: 235

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