Technical Anshu
Tutorials Blog
⚡ Bulk Creation

Create Active Directory Users in Bulk from CSV with PowerShell

The wizard is fine for one joiner and miserable for fifty. This page shows the CSV plus PowerShell pattern that bulk creation actually uses, with the dry run and the spot checks that keep it safe.

✍️ Technical Anshu🪟 Windows Server⏱️ 9 minute read
🎥 Watch the full video - every OU, user and group created live, step by step

Bulk creation has one rule: the script is only as good as the spreadsheet. A tidy CSV, a five-account test batch, and a verification pass will onboard a whole branch in minutes. A messy CSV will create fifty tidy accounts with the wrong OU, the wrong naming style and no password-change flag - at machine speed. This page goes in the safe order: build the CSV, test small, run, verify.

users.csv - the input a bulk script deserves (example rows)
Name,Sam,OU,Password,Department Priya Verma,priya.verma,"OU=Sales,OU=Delhi Office,DC=office,DC=local",Start@2026,Sales Amit Kumar,amit.kumar,"OU=Sales,OU=Delhi Office,DC=office,DC=local",Start@2026,Sales
Same starter password in the sheet is fine only because every account forces a change at first logon.

One row per person, the full OU path in its own column, and a header row spelled exactly as the script expects.

1

Build the CSV like the script will read it

One row per user, with columns for the fields you actually set: name, logon name, OU path, department and starter password. The OU column carries the full distinguished name - OU=Sales,OU=Delhi Office,DC=office,DC=local - because "Sales" alone matches nothing. Build the sheet from your HR list, apply your naming rule in the spreadsheet (not by eye during the run), and sort out duplicate logon names before the script ever sees them.

2

The script itself - Import-Csv feeding New-ADUser

The classic pattern is short enough to keep in your toolkit:

Import-Csv C:\users.csv | ForEach-Object { New-ADUser -Name $_.Name -SamAccountName $_.Sam -Path $_.OU -Department $_.Department -AccountPassword (ConvertTo-SecureString $_.Password -AsPlainText -Force) -Enabled $true -ChangePasswordAtLogon $true }

Every line matters: -Path lands accounts in the right OU, -Enabled $true makes them usable, and -ChangePasswordAtLogon $true is what makes the shared starter password in the CSV acceptable. Plain-text starter passwords in a sheet are a calculated exception - the file gets deleted after the run, and every password in it dies at first logon.

3

Test with five rows before you run five hundred

Copy the first five rows into a small test CSV and run the script on that. Then check like a sceptic: open two accounts in ADUC and confirm the OU, the naming and the change-password flag; try signing in as one of them and watch Windows demand a new password. Only then run the full file. Five minutes of testing is the entire difference between a bulk tool and a bulk incident.

4

Verify the result, then delete the CSV

Count what you made: Get-ADUser -Filter * -SearchBase "OU=Delhi Office,DC=office,DC=local" | Measure-Object should match your expectations, and a quick scroll through the list catches the one row that landed in the wrong OU. Then delete the CSV and empty it from anywhere it was copied - it contains starter passwords, and even short-lived passwords do not belong in a shared folder forever.

5

When the wizard is still the right tool

Honestly: for one or two joiners, the wizard plus the Copy action from a template account is faster than editing a CSV. Bulk scripting pays off from roughly ten accounts upward, and for repeatable intakes - a monthly batch of trainees, a new branch - where the same script runs again and again. Automate the repeatable; do not automate the rare just to feel advanced.

🟡 The CSV is a password file until the run ends. Keep it on the server, run the script, verify the accounts, then delete the file. The first-logon change flag limits the damage window - deleting the sheet closes it.

🎥 Watch the Complete Video

The full OU, user and group creation process - live on a real domain controller, step by step.

▶️ Watch Full Video
❓ Common Questions (FAQ)

The script failed on some rows but worked on others. What now?

Read the error per row - the usual causes are a duplicate logon name, a mistyped OU path, or a password that fails the domain policy. Fix the sheet for just the failed rows, put them in a small CSV, and run again. The successful rows are already created; do not re-run the whole file.

Can the script also add users to groups?

Yes - a second pass with Add-ADGroupMember using a Group column in the CSV is the standard pattern, and it keeps the group-first permission rule intact even in bulk. Test it on the same five-row file first.

Our starter passwords get rejected as too weak. Why?

The domain password policy applies to scripted creation exactly as it does to the wizard - length and complexity rules included. Use starter passwords that pass policy; since every user replaces theirs at first logon, a shared strong pattern per batch is workable.

This guide is based on the Technical Anshu video on Active Directory OU, user and group creation • Stuck on a step? Ask in the video comments - you will get a reply 🙏