Description: This tool command adds some specific object types to the directory. dsadd command:
dsadd computer - Add the computer to the directory.
dsadd contact - adds a contact to the directory. The
dsadd group - adds a group to the directory. The
dsadd ou - adds an organizational unit to the directory. The
dsadd user - adds users to the directory. The
dsadd quota - adds quota rules to the directory partition.
to find help on specific commands, type "dsadd <objecttype> /?", where
<ObjectType> Is the type of a supported object shown above.
For example, dsadd ou /?.
Note:
A comma that is not used as a delimiter in a distinguished name must be backslash ("\") character escape
(for example, "cn=company\, inc.,cn=users,dc= Microsoft,dc=com "). The backslash
used in a distinguished name must be escaped with a backslash (for example,
Cn=sales\\ latin america,ou=distribution lists,dc=microsoft, Dc=com ").
Directory Service command-line tool Help:
dsadd /? - Help for adding objects.
dsget /? - Help for displaying objects. The
dsmod /? - help for modifying the object.
dsmove /? - Help for moving objects. The
dsquery /? - find help matching search criteria objects.
dsrm /? - Help for deleting objects.
Copy Code code as follows:
for/f "tokens=1,2,3,4,5,6 delims=,"%a in (information.csv) do dsadd user "cn=%d,ou=hr,dc=contoso,dc=com"-samid%d-upn %f@contoso.com-ln%B-FN%c-pwd%e-disabled Yes