Recipe2.14.Enumerating All Exchange Connectors


Recipe 2.14. Enumerating All Exchange Connectors

Problem

As part of your preparation for a migration from Exchange 5.5, or an upgrade from Exchange 2000, you want to list all of the active connectors in the organization so you can identify which ones will be affected, or need to be recreated, when it's time to decommission old servers. It's important to be sure that your routing environment will continue to work post-migration, and by first checking which connectors are deployed on which servers, you're covering all the bases.

Solution

Using a graphical user interface

There's no good way to do this with the GUI. The best way is to use Exchange System Manager to poke around in the Connectors container of each routing group in your organization; when you select such a container, you'll see a list of the connector names and types (e.g., routing group connector, X.400, etc.). This is tiresome in large organizations.

Using a command-line interface

The following command will query Active Directory to find existing Exchange connectors, the address space they serve, and their costs:

>dsquery * "cn=microsoft exchange,cn=services,cn=configuration,<ForestRootDN>"    -filter "(objectCategory=msExchConnector)" -scope subtree -attr name routingList

Using VBScript
' This code uses WMI to interrogate the Exchange routing table  ' and list all connectors in the Exchange organization. ' ------ SCRIPT CONFIGURATION ------  strComputerName = "<ServerName>"    ' ------ END CONFIGURATION --------- strWMIQuery = "winmgmts://" & strComputerName &_    "/root/cimv2/applications/exchange"     set connectorList= GetObject(strWMIQuery).InstancesOf("ExchangeConnectorState") for each ExchangeConnector in connectorList     WScript.Echo "Name:             " & ExchangeConnector.Name     WScript.Echo "DN:               " & ExchangeConnector.GroupDN     WScript.Echo "Routing Group DN: " & ExchangeConnector.Version     If (ExchangeConnector.IsUp) Then         WScript.Echo ("Status:          : Up")         Else         WScript.Echo ("Status:          : Down")     End If Next

Discussion

Using VBScript

The ExchangeConnectorState class gives you information on connectors throughout the entire organization, since it reads connector data from the link-state routing table. You can see the name and status of individual links, but to access the queue contents you'll need to use the Exchange link and queue objects (there are different versions for Exchange 2000 and Exchange Server 2003).

See Also

Recipe 2.13 for enumerating servers, and Chapter 7 for creating, deleting, and modifying connectors; the ExchangeConnectorState WMI class in MSDN



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