JSI Tip 7382. The DSMOVE command moves or renames an object in the Active Directory.
October 27, 2003
The DSMOVE command is one of the Active Directory command-line tools.
When you type dsmove /?, you receive:
Description: This command moves or renames an object within the directory.Syntax: dsmove [-newparent ] [-newname ] [{-s | -d }] [-u ] [-p { | *}] [-q] [{-uc | -uco | -uci}]Parameters:Value Description Required/stdin. Distinguished name (DN) of object to move or rename. If this parameter is omitted it will be taken from standard input (stdin).-newparent DN of the new parent location to which object should be moved.-newname New relative distinguished name (RDN) value to which object should be renamed.{-s | -d } -s connects to the domain controller (DC) with name . -d connects to a DC in domain . Default: a DC in the logon domain.-u Connect as . Default: the logged in user. User name can be: user name, domainuser name, or user principal name (UPN).-p Password for the user . If * is used, then the command prompts for a password.-q Quiet mode: suppress all output to standard output.{-uc | -uco | -uci} -uc Specifies that input from or output to pipe is formatted in Unicode. -uco Specifies that output to pipe or file is formatted in Unicode. -uci Specifies that input from pipe or file is formatted in Unicode.
Remarks:
If a value that you supply contains spaces, use quotation marksaround the text (for example, "CN=John Smith,CN=Users,DC=microsoft,DC=com").If you enter multiple values, the values must be separated by spaces(for example, a list of distinguished names).
Commas that are not used as separators in distinguished names must beescaped with the backslash ("") character(for example, "CN=Company, Inc.,CN=Users,DC=microsoft,DC=com").Backslashes used in distinguished names must be escaped with a backslash(for example,
"CN=Sales\ Latin America,OU=Distribution Lists,DC=microsoft,DC=com").
Examples:
The user object for the user Jane Doe can be renamed to Jane Joneswith the following command:
dsmove "cn=Jane Doe,ou=sales,dc=microsoft,dc=com" -newname "Jane Jones"
The same user can be moved from the Sales organization to the Marketingorganization with the following command:
dsmove "cn=Jane Doe,ou=sales,dc=microsoft,dc=com" -newparent ou=Marketing,dc=microsoft,dc=com
The rename and move operations for the user can be combined with thefollowing command:
dsmove "cn=Jane Doe,ou=sales,dc=microsoft,dc=com" -newparent ou=Marketing,dc=microsoft,dc=com -newname "Jane Jones"
About the Author
You May Also Like