# Create multiple users and add to security group

**URL:** <https://forums.powershell.org/t/create-multiple-users-and-add-to-security-group/10270>\
**Category:** PowerShell Help\
**Created:** [March 9, 2018, 9:11am UTC](https://forums.powershell.org/t/create-multiple-users-and-add-to-security-group/10270 "2018-03-09T09:11:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamminjamie](https://avatars.discourse-cdn.com/v4/letter/j/a698b9/32.png) [@jamminjamie](https://forums.powershell.org/u/jamminjamie)\
**Post date:** [March 9, 2018, 9:11am UTC](https://forums.powershell.org/t/create-multiple-users-and-add-to-security-group/10270/1 "2018-03-09T09:11:00Z")

</div>

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.

Thanks,

Jamie

---

<div class="post-metadata">

**Author:** ![postanote](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@postanote](https://forums.powershell.org/u/postanote)\
**Post date:** [March 9, 2018, 12:11pm UTC](https://forums.powershell.org/t/create-multiple-users-and-add-to-security-group/10270/2 "2018-03-09T12:11:45Z")

</div>

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 'blogs.technet.microsoft.com/canitpro/2015/03/04/step-by-step-utilizing-powershell-history-viewer-in-windows-server-2012-r2'

> Learning PowerShell with Active Directory Administrative Center (PowerShell History Viewer) 'sid-500.com/2017/10/10/learning-powershell-with-active-directory-administrative-center-powershell-history-viewer'

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:36pm UTC](https://forums.powershell.org/t/create-multiple-users-and-add-to-security-group/10270/3 "2024-05-16T20:36:14Z")

</div>


