Recipe 15.12. Moving an Object to a Different DomainProblemYou want to move an object to a different domain within the same forest. SolutionUsing a command-line interface> movetree /start /s SourceDC /d TargetDC /sdn SourceDN /ddn TargetDN In the following example, the cn=jsmith object in the amer.rallencorp.com domain will be moved to the emea.rallencorp.com domain: > movetree /start /s dc-amer1 /d dc-emea1 /ddn cn=jsmith,cn=users,dc=amer,dc=rallencorp,dc=com /sdn cn=jsmith,cn=users,dc=emea,dc=rallencorp,dc=com Using VBScriptset objObject = GetObject("LDAP://TargetDC/TargetParentDN") objObject.MoveHere "LDAP://SourceDC/SourceDN", vbNullString In the following example, the cn=jsmith object in the amer.rallencorp.com domain will be moved to the emea.rallencorp.com domain: set objObject = GetObject( _ "LDAP://dc-amer1/cn=users,dc=amer,dc=rallencorp,dc=com") objObject.MoveHere _ "LDAP://dc-emea1/cn=jsmith,cn=users,dc=emea,dc=rallencorp,dc=com", _ vbNullString DiscussionYou can move objects between domains assuming you follow a few guidelines:
There is currently no direct method to move user accounts between domains in different forests. This requires a restructuring tool such as ADMT 2.0, which actually creates new objects rather than actually moving the original objects. You can download ADMT from http://download.microsoft.com. See AlsoChapter 4 of Active Directory Cookbook (O'Reilly) for more on LDAP controls, MS KB 238394 (How to Use the MoveTree Utility to Move Objects Between Domains in a Single Forest), and MSDN: IADsContainer::MoveHere |