Create multiple users and add to security group

Welcome Forums General PowerShell Q&A Create multiple users and add to security group

This topic contains 1 reply, has 2 voices, and was last updated by

11 months, 2 weeks ago.

  • Author
  • #95549

    Points: 0
    Rank: Member

    Hello All,

    I am trying to come up with a script to pull from a .csv, create new users, set their password to not expire and user cannot change and add them to a specific security group. Here is what I have so far:

     import-csv c:\powershell\newusers.csv | new-aduser -AccountPassword (ConvertTo-SecureString Pizza123 -AsPlainText -force) -enabled $true 

    Whenever I add the password parameters, the script will work but it won't actually set those options when I look at the accounts in AD. Also, any help with adding them to a specific security group upon creation would be helpful.



  • #95580

    Points: 780
    Helping Hand
    Rank: Major Contributor

    Open the ADAC on WS2K8 and higher, and click thru the UI to do these steps for one test user and it will write the PoSH code for you that once you copy and save it, you can tweak for bulk users.

    Step-By-Step: Utilizing PowerShell History Viewer in Windows Server 2012 R2

    Learning PowerShell with Active Directory Administrative Center (PowerShell History Viewer)

The topic ‘Create multiple users and add to security group’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort