Bulk import of AD users using PowerShell

Source: Internet
Author: User
Tags samaccountname

    1. Create a text document to save as a CSV file, note the encoding format, or the import is garbled after the

      650) this.width=650; "Src=" Https://s2.51cto.com/wyfs02/M01/06/1D/wKiom1mx_rTgS1HaAADFk4mu5_g826.png-wh_ 500x0-wm_3-wmp_4-s_2507874724.png "title=" Snipaste20170908_101926.png "alt=" wkiom1mx_rtgs1haaadfk4mu5_ G826.png-wh_50 "/>

      650) this.width=650; src= https://s2.51cto.com/wyfs02/M01/A4/CE/wKioL1mx_p_ Yonngaacmsy5p9ww834.png-wh_500x0-wm_3-wmp_4-s_2597880478.png "title=" 2.png "alt=" Wkiol1mx_p_ Yonngaacmsy5p9ww834.png-wh_50 "/>

    2. Import with powellshell command

      Import-csv-path E:\users.csv | foreach {new-aduser-name $_.name-samaccountname $_.samaccountname-givenname $_.givenname-surname $_.surname-displayname $_. Displayname-path $_.path-userprincipalname $_.userprincipalname-accountpassword  (ConvertTo-SecureString- string  $_.accountpassword-asplaintext-force)  -enabled $true-changepasswordatlogon $false}

3. View established users

650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M01/06/1D/wKiom1mx_yHQmLpKAABmhbLrwq8507.png-wh_500x0-wm_ 3-wmp_4-s_2552090050.png "title=" 3.png "alt=" Wkiom1mx_yhqmlpkaabmhblrwq8507.png-wh_50 "/>

This article is from the "Record Bit Technology" blog, please make sure to keep this source http://seawind.blog.51cto.com/6845370/1963593

Bulk import of AD users using PowerShell

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.