Recipe 7.10. Moving a Server Between Routing GroupsProblemYou wish to move an Exchange server to a different routing group. SolutionUsing a graphical user interface
Using VBScript' This code moves an Exchange server to a different routing group. ' ------ SCRIPT CONFIGURATION ------ ' The common name of the Exchange server object strExchangeServer = "<ExchangeServerName>" ' e.g., red-exch02 ' Name of the administrative group the server is a member of strSourceAG = "<SourceAG>" ' e.g., SeattleAG ' Name of the target routing group to move the server to strTargetRG = "<TargetRG>" ' e.g., RedmondRG ' Name of the administrative group the target routing group is in ' If you are in mixed mode, this must be the same as strSourceAG. strTargetAG = "<TargetAG>" ' e.g., RedmondAG ' Name of the Exchange organization strExchangeOrg = "<ExchangeOrg>" ' e.g., ExampleOrg ' ------ END CONFIGURATION --------- strConfigDN = GetObject("LDAP://RootDSE").Get("configurationNamingContext") strExchangeServerDN = "LDAP://CN=" & strExchangeServer & ",CN=Servers,CN=" & _ strSourceAG & ",CN=Administrative Groups,CN=" & _ strExchangeOrg & ",CN=Microsoft Exchange,CN=Services," & _ strConfigDN strTargetRGDN = "CN=" & strTargetRG & ",CN=Routing Groups,CN=" & _ strTargetAG & ",CN=Administrative Groups,CN=" & _ strExchangeOrg & ",CN=Microsoft Exchange,CN=Services," & _ strConfigDN Set objExchangeServer = GetObject(strExchangeServerDN) objExchangeServer.Put "msExchHomeRoutingGroup", strTargetRGDN objExchangeServer.SetInfo Wscript.Echo strExchangeServer & "is now in the " &_ strTargetRG & " routing group." & VbCrLF DiscussionRemember that an Exchange 2000/2003 routing group is simply a group of Exchange servers with sufficient stable local bandwidth and low enough connection latency to permit each member server to send all traffic directly to other members. Any traffic destined outside the routing group, whether to another server in a different routing group in the same Exchange organization or to a foreign server, must be routed through the appropriate connector. Given the typical Exchange 2000/2003 deployment, there is a good chance that most Exchange administrators will need to change their routing group configuration at some point. Three common reasons for needing to change routing group membership include but are not limited to:
Changing a server's routing group membership using ESM is simple; it is literally a drag-and-drop operation. It is just as easy to do with a script, even though there are no ready examples of the process in the MSDN documentation. MS KB 830828 gives the necessary hint: routing group membership is controlled by the msExchHomeRoutingGroup attribute on the server object in Active Directory. If you change this attribute, Active Directory will automatically update the msExchRoutingGroupMembersBL on the source and destination routing group objects to reflect the respective deletion and addition. Our script constructs two strings: the full DN of the server to move and the full DN of the routing group it will be joining. We then perform a standard ADSI task: bind to the desired object (the Exchange server) and update the msExchHomeRoutingGroup property with the new value. Note that you can move servers into a routing group that belongs to a different administrative group if your organization is in native mode. The server's administrative group membership does not change when you do this. Your production scripts should check to ensure that the target routing group has the msExchRoutingMasterDN attribute set after the server has been moved. Moving a server into an empty routing group will not set this value automatically, which would result in the server not receiving routing updates. You should also set a new RGM for the existing routing group before you move that server. Recipe 7.9 shows you how to set this value. See AlsoRecipe 7.7 for creating routing groups, Recipe 7.8 for deleting them, Recipe 7.9 for setting the RGM, and MS KB 830828 (How to Manually Re-Create a Routing Group After the Routing Group Is Accidentally Removed) |