DSMOVE.exe (installable option either via RSAT /AD DS or adminpack.msi)

Rename or Move an active directory object (user, computer, group..) to a different Organisational Unit (OU).

Syntax
      DSMOVE ObjectDN [-newname NewRDN] [-newparent ParentDN]
         [{-s Server | -d Domain}]
            [-u UserName] [-p {Password | *}]
               [-q] [{-uc | -uco | -uci}]

Options
   ObjectDN   Distinguished name of the computer that you want to add.
              If omitted will be taken from standard input (stdin)

   -newname   Rename the object with a new Relative Distinguished Name.

   -newparent New location for the object, enter the new parent DN.

   -q         Quiet, suppress all output

   -uc        Unicode format
   -uco       Unicode format for output only
   -uci       Unicode format for input only

   -u UserName The user name with which a user logs on to a remote server.
               By default, the currently logged on user.

   -p Password The password, or * to prompt for a password.

By default, DSMOVE connects the computer to the domain controller in the logon domain.

For any DS command you can enter multiple values separated by spaces.
e.g. to modify several user accounts at once just supply a list of the distinguished names separated with spaces.

Examples

Rename a user:

C:\> set _andy="CN=Andrew Gorden,OU=Europe,DC=ss64,DC=Com"
C:\> dsmove %_andy% -newname "Andrew Gordon"

Move a user to a different OU

C:\> set _andy="CN=Andrew Gordon,OU=Europe,DC=ss64,DC=Com"
C:\> set _newOrgUnit="OU=Asia,DC=ss64,DC=Com"
C:\> dsmove %_andy% -newparent %_newOrgUnit%

“All that glitters is not gold. All who wander are not lost” ~ William Shakespeare

Related:

DSAdd - Add object
DSMod - Modify object
DSGet - Display object
DSQuery - Search for objects
DSRM - Delete object
CSVDE - Import or export AD info in CSV format.
LDIFDE - Edit AD Objects, extend schema, import or export AD information.
Q322684 - Directory Service Command-Line Tools
Equivalent bash commands (Linux): ldapmodify - Modify Lightweight Directory Access Protocol


© Copyright SS64.com 1999-2014
Some rights reserved