' This script was originally published in the Exchange Cookbook, ' (http://www.exchangebookcook.com). Written by Paul Robichaux, ' Missy Koslosky, and Devin Ganger. Redistributed with permission ' of the publisher, O'Reilly & Associates. ' This code moves an Exchange server to a different routing group. ' ------ SCRIPT CONFIGURATION ----- ' The common name of the Exchange server object strExchangeServer = "" ' e.g., red-exch02 ' Name of the administrative group the server is a member of strSourceAG = "" ' e.g., SeattleAG ' Name of the target routing group to move the server to strTargetRG = "" ' 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 = "" ' e.g., RedmondAG ' Name of the Exchange organization strExchangeOrg = "" ' 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