Create ad users in batches from CSV files with source code.

Source: Internet
Author: User
Tags samaccountname

A few days ago, my colleagues needed such a tool. In fact, there were some such tools, but they were not very comfortable. So I wrote one, just reading CSV text, then, relevant attributes and values are created in the specified ou, And the failure and failure causes are recorded.

The CSV format is as follows (Red partIs a required column, correspondingName, Logon Name, password, and ou):

CN, samaccountname, password, ou, Mobile
Test10a0, test10a0, 123456a ?, "Ou = ou1, Dc = contoso, Dc = com", 111111
Test10a1, test10a1, 123456a ?, "Ou = ou1, Dc = contoso, Dc = com", 111111

......

You can add columns in CSV to add the initial attributes for automatic creation. The column name is the attribute name of the object, which can be viewed from adsiedit. in MSC, you can perform self-search. For example, if you want to automatically create a phone property at the same time, the corresponding attribute is telephonenumber, as shown below:

CN, samaccountname, password, ou, Mobile, telephonenumber
Test10a0, test10a0, 123456a ?, "Ou = ou1, Dc = contoso, Dc = com", 111111,88888

Procedure:

1. Select a CSV file and click open.

2. Enter the user name, password, and domain name (format:Contoso.com)

3. Start execution

The interface is as follows:

Download the test CSV file. Note: You can use Excel to quickly change ou to the path in your environment. Download

Source codeDownloadNo modification. Sorry.

 

Hope to help some information workers!

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.