Add the user's code with dsadd _dos/bat

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.