DSADD User (installable option via RSAT /AD DS)

Add a user account to active directory.

      DSADD User UserDN [-samid SAMName] [-upn UPN] [Options] [-q] [{-uc | -uco | -uci}]

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

   SAMName  Unique SAM account name for this user
            (By default, the first 20 chars from the UserDN/CN).

   UPN      User Principal Name of the user to add, e.g. fred@SS64.com

   -q       Quiet, suppress all output.

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


   [-fn GivenName] [-mi Initial] [-ln Surname] [-display DisplayName]
   [-empid EmployeeID] [-pwd {Password | *}]
   [-desc Description] [-memberof Group ...] [-office Office] [-tel PhoneNumber]
   [-email Email] [-hometel HomePhoneNumber] [-pager PagerNumber]
   [-mobile CellPhoneNumber] [-fax FaxNumber] [-iptel IPPhoneNumber]
   [-webpg WebPage] [-title Title] [-dept Department]
   [-company Company] [-mgr ManagersDistinguishedName]
   [-hmdir HomeDirectory] [-hmdrv DriveLetter:][-profile ProfilePath]
   [-loscr ScriptPath] [-mustchpwd {yes | no}] [-canchpwd {yes | no}]
   [-reversiblepwd {yes | no}] [-pwdneverexpires {yes | no}]
   [-acctexpires NumberOfDays] [-disabled {yes | no}]
   [{-s Server | -d Domain}]
   [-u UserName] [-p {Password | *}]

The special token $username$, can be used to replace the SAM account name in the value of the -email, -hmdir, -profile, and -webpg parameters.


Add the user fred to Active Directory:

dsadd user "cn=fred,ou=staff,dc=ss64,dc=com"

Add the user JohnS to Active Directory along with GivenName and Surname:

dsadd user "cn=JohnS,cn=users,dc=ss64,dc=com" -fn "john" -ln "Smith" -disabled no

“For a list of all the ways technology has failed to improve the quality of life, press three” ~ Alice Kahn

Related commands

DSAdd - Add object.
DSMod - Modify object. DSMod User - Modify a user account in active directory.
DSGet - Display object. DSGet User - Display user(s) from active directory.
DSMove - Move object.
DSQuery - Search for objects.DSQuery User - Search for users in active directory.
DSRM - Delete object / Delete a user account from active directory.
CSVDE - Import or export AD info in CSV format.
LDIFDE - Edit AD Objects, extend schema, import or export AD information.
PowerShell: New-adUser - Create a new AD user.
Equivalent bash commands (Linux): useradd - Add user.

Copyright © 1999-2024 SS64.com
Some rights reserved