Windows Tools

MoveTree Examples

Overview | Notes | Syntax | Examples | Related Tools Open Command Prompt

These examples assume the following scenario:

In the Marketing domain, there is a server called "Server1" and an organizational unit called "Promotions". In the Sales domain, there is a server called "Server2". The desired operation is to move the "Promotions" organizational unit from the Marketing domain to the Sales domain, and rename the new organizational unit "Sales Promotions".

Example 1: Perform MoveTree Operation Test Run and Move

You want to move the Promotions organizational unit from the Marketing domain to the Sales domain and rename the Promotions organizational unit to Sales Promotions. You decide that you want to do a test run and only perform the move if the test executes without errors. Type the following at the command line:

movetree /start /s Server1.Marketing.Microsoft.Com /d Server2.Sales.Microsoft.com /sdn OU=Promotions,DC=Marketing,DC=Microsoft,DC=Com /ddn OU=Sales Promotions,DC=Sales,DC=Microsoft,DC=Com

Example 2: Move Tree without Test

You want to move the Promotions organizational unit from the Marketing domain to the Sales domain and rename the Promotions organizational unit to Sales Promotions. You decide to do the move without doing a test run first. Type the following at the command line:

movetree /startnocheck /s Server1.Marketing.Microsoft.Com /d Server2.Sales.Microsoft.Com /sdn OU=Promotions,DC=Sales,DC=Microsoft,DC=Com /ddn OU=Sales Promotions,DC=Sales,DC=Microsoft,DC=Com

Example 3: Resume a Failed MoveTree Operation

A previous MoveTree operation between Server1 in the Marketing domain and Server2 in the Sales domain failed while the objects were being moved into the "Sales Promotion" organizational unit. To resume a failed the failed operation, type the following at the command line:

movetree /continue /s Server1.Marketing.Microsoft.Com /d Server2.Sales.Microsoft.Com /ddn OU=Sales Promotions,DC=Sales,DC=Microsoft,DC=Com

Example 4: Test a MoveTree Operation

Eventually you would like to move the Promotions organizational unit from the Marketing domain to the Sales domain, renaming it to Sales Promotions. You decide to do a test run and get verbose output to study before you perform the actual move. To perform this test using the credentials of Microsoft\administrator with the password "********" type the following at the command line:

movetree /check /s Server1.Marketing.Microsoft.Com /d Server2.Sales.Microsoft.Com /sdn OU=Promotions,DC=Sales,DC=Microsoft,DC=Com /ddn OU=Sales Promotions,DC=Sales,DC=Microsoft,DC=Com /verbose /u Microsoft\administrator /p ********

Example 5: Use MoveTree in a Batch File

You want to move the Promotions organizational unit from the Marketing domain to the Sales domain and rename the Promotions organizational unit to Sales Promotions. You decide that you want to do a test run and only perform the move if the test executes without errors, but you would like to do this from a batch file. Create a batch file with the following content:

movetree /check
 /s Server1.Marketing.Microsoft.Com
 /d Server2.Sales.Microsoft.Com
 /sdn OU=Promotions,DC=Marketing,DC=Microsoft,DC=Com
 /ddn OU=Sales Promotions,DC=Sales,DC=Microsoft,DC=Com
if errorlevel 0 goto start
goto exit
:start
movetree /start
 /s Server1.Marketing.Microsoft.Com
 /d Server2.Sales.Microsoft.Com
 /sdn OU=Promotions,DC=Marketing,DC=Microsoft,DC=Com
 /ddn OU=Sales Promotions ,DC=Sales,DC=Microsoft,DC=Com
:exit

For more information about error in MoveTree, see MoveTree ErrorLevels in MoveTree Notes.