Create Active Directory users programatically using the PowerShell New-ADUser cmdlet.
New-ADUser creates users at scale, sets attributes, places them in the right Organizational Units (OUs), assigns passwords, and even adds them to groups, all programmatically. Let’s get into how to learn more about New-ADUser and elevate your AD management skills from good to great.
🎬 Watch This Week in IT.
Here’s the basic command for creating a new Active Directory user:
New-ADUser -Name “Richard Reinders”
Now let’s have a look in more detail how the New-ADUser PowerShell cmdlet works.
At its core, New-ADUser is a cmdlet in the ActiveDirectory module for PowerShell. It allows you to create new user accounts in your AD domain directly from the command line or within scripts.

Think of it as the quicker version of clicking New > User in ADUC. Instead of filling out fields manually, you describe the user on the PowerShell command line.
Here’s what makes it powerful:
So why not just stick to the GUI (ADUC or Active Directory Administrative Center)? Because PowerShell is:
In large organizations, compliance is always important. This repeatability and traceability can’t be overstated. PowerShell also allows you to connect AD management to other systems (like HR or ticketing tools), which is nearly impossible with just ADUC.
Let me show you the basics and syntax of the New-ADUser cmdlet in PowerShell. I’ll utilize my Active Directory lab and start on one of my Windows 11 client virtual machines.
New-ADUser -Name "Eugene Reinders" -SamAccountName "ereinders" -UserPrincipalName "[email protected]" -AccountPassword (Read-Host -AsSecureString "Enter Password") -Enabled $true

Nice and simple, no errors. This is just a taste of what this command can do. Don’t worry, I’ll explain how the command works and dig deeper in just a little bit. But first…
The only prerequisite is that you have the Active Directory module installed and imported. On a member server, you can install it by running this command.
Add-WindowsFeature RSAT-AD-PowerShell
If you’re on a Windows 10/11 client machine, try this.
Install-WindowsFeature RSAT:ActiveDirectory
Then you can import the cmdlets with this.
Import-Module ActiveDirectory
All set!
If you’re running PowerShell directly on a domain-joined system with appropriate credentials, you’re already connected.
But if you’re managing remotely or need to connect under different credentials:
$cred = Get-Credential
Connect-ADServiceAccount -Credential $cred
You’ll need sufficient permissions in AD to create user objects in the target OU. Typically, this means being a member of Account Operators, Domain Admins, or having delegated permissions to create users in a specific OU.
If your command fails with “Access Denied”, double-check:
Before writing any command, plan what attributes your organization requires for new accounts:
It helps to plan out a template of sorts – essentially, the standard set of attributes every new user should have.
Let’s start with the simplest example.
Run this command to create a new user named “Richard Reinders” in the default Users container in AD and starts disabled.
New-ADUser -Name “Richard Reinders”

You’ll rarely ever need or use this example, but it’s good to start with the basics.
Let’s expand this into something more useful:
New-ADUser -Name “Thomas Reinders” -GivenName “Thomas” -Surname “Reinders” -DisplayName “Thomas Reinders” -SamAccountName “treinders” -UserPrincipalName “[email protected]” -Title “Finance Manager” -Department “Finance” -EmailAddress “[email protected]” -Enabled $true -AccountPassword (ConvertTo-SecureString "Autumn2025!" -AsPlainText -Force)

Here, we’re offering a fuller identity from the outset. The account is created, valid, and ready for login. The password is set and meets requirements (as it would have given an error). However, not very secure. That is next.
Always set the attribute to have the user change their password at their next login when creating an account. We can do that thusly:
Set-ADUser -Identity treinders -ChangePasswordAtLogon $true
All set. You can also use the same ‘-ChangePasswordAtLogon’ switch when creating the account with New-ADUser.
Once you’ve mastered the basics, you can add sophistication to your scripts.
By default, users are created in the Users container. You can specify an OU path. You can find OU paths by right-clicking an OU in ADUC → Properties → Attribute Editor → Copy the value of distinguishedName.
New-ADUser -Name “Victor Reinders” -Path “OU=Domain Users,DC=reinders,DC=local”

Here is how we can add users to groups in AD using Add-ADGroupMember.
Add-ADGroupMember -Identity “Financial_Access” -Members treinders

Thomas Reinders is now in the Financial_Access security group.
UAC flags control settings like whether the account is disabled, requires a password, or is locked out.
For instance, to set a password not required (common for service accounts).
New-ADUser -Name "svcBackup" -SamAccountName "svcBackup" -PasswordNotRequired $true -Enabled $true
Nice and simple.
Active Directory supports dozens of optional attributes. Here’s an expanded example.
New-ADUser -Name "Stan Reinders" -SamAccountName "sreinders" -UserPrincipalName "[email protected]" -Title "IT Support Specialist" -Department "IT" -OfficePhone "555-123-4567" -StreetAddress "998 Main St" -City "Milwaukee" -State "WI" -PostalCode "53202" -Company "Reinders Consulting" -Enabled $true -AccountPassword (ConvertTo-SecureString "P@ssword2025!" -AsPlainText -Force)
Again, thinking about scripting and automation, you can make these as ‘large’ as you want…they’re just goign to run in a script. You can create scripts that create a hundred users, in different OUs, with different departments, managers, etc. The script would literally take seconds to run, and you’re done and ready for testing. Let’s touch on this next.
To carry on from what I was stating above, we’re now ready to start using CSV files to batch-create more than one user at a time.
Let’s start with a simple CSV file – users.csv

Now, we’ll use a script to import the contents of the file and iterate through each user (row) into the New-ADUser command.
$users = Import-Csv "C:\users\mreinders\downloads\users.csv"
foreach ($user in $users) {
$password = (ConvertTo-SecureString $user.Password -AsPlainText -Force)
New-ADUser `
-Name "$($user.FirstName) $($user.LastName)" `
-GivenName $user.FirstName `
-Surname $user.LastName `
-SamAccountName $user.SamAccountName `
-UserPrincipalName "$($user.SamAccountName)@reinders.local" `
-Department $user.Department `
-Title $user.Title `
-AccountPassword $password `
-Enabled $true `
-ChangePasswordAtLogon $true
}

Our 3 users are there!
For production environments, you can enhance it:
try/catch).Here’s a sample you can use to craft to your environment.
try {
if (Get-ADUser -Filter "SamAccountName -eq '$($user.SamAccountName)'") {
Write-Host "User $($user.SamAccountName) already exists. Skipping."
} else {
New-ADUser ... # user creation code
Write-Host "Created user: $($user.SamAccountName)"
}
} catch {
Write-Error "Failed to create user: $($user.SamAccountName) - $_"
}
Let’s share some common issues you’re likely to run into when using New-ADUser.
When users share names, use a naming pattern that ensures uniqueness.
$Sam = ($user.FirstName.Substring(0,1) + $user.LastName)
$count = 1
while (Get-ADUser -Filter "SamAccountName -eq '$Sam'") {
$Sam = ($user.FirstName.Substring(0,1) + $user.LastName + $count)
$count++
}
This logic automatically increments usernames like treinders1, treinders2, etc.
If your domain enforces password complexity (and you better be doing so!), ensure the passwords in your CSV or scripts meet the requirements. Otherwise, the command fails silently with “The password does not meet complexity requirements”.
You can pre-validate password complexity using regex or enforce length and character rules.
Here are some common error messages when using New-ADUser to save you some searching in the future…
| Error | Cause | Fix |
|---|---|---|
| “Access Denied” | Insufficient permissions | Run as domain admin or delegate rights |
| “The password does not meet complexity requirements” | Weak password | Use complex strings with numbers and symbols |
| “Cannot find path specified” | Incorrect OU DN | Verify the distinguishedName path |
| “User already exists” | Duplicate SAM or UPN | Add a uniqueness check before creation |
Now, let’s gather some industry and community best practices and standards when working with User Management with PowerShell.
Avoid embedding plaintext passwords directly in scripts. Instead:
$Password = Read-Host "Fall2025!" -AsSecureStringExport-Clixml.Wrap creation commands in try/catch blocks. Capture errors with $ErrorActionPreference = 'Stop' to handle gracefully and log issues.
Clear documentation makes scripts maintainable. Add meaningful comments explaining the purpose of each section.
# Create new AD user from CSV input
# Script version 2.1 - Updated October 2025
Always test in a lab or sandbox AD first. Use a lab! They really are invaluable. Once validated, move to production with caution. You can add a -WhatIf parameter to simulate the command safely:
New-ADUser -Name "Test User" -WhatIf
This shows what would happen—without making changes.
Thank you for reading my post on using New-ADUser to create users in Active Directory. If you have any questions, please leave a comment/question below.
New-ADUser is a PowerShell cmdlet in the Active Directory module used to create new user accounts in an Active Directory (AD) environment.
It allows administrators to define all the properties of a user—such as name, logon name, password, organizational unit (OU), and more—at the time of creation.
This cmdlet is part of the ActiveDirectory module, which is included in Windows Server with the Active Directory Domain Services (AD DS) role or can be installed on Windows 10/11 with RSAT tools.
New-ADUser -Name "John Doe" -GivenName "John" -Surname "Doe" -SamAccountName "jdoe" -UserPrincipalName "[email protected]" -Path "OU=Users,DC=domain,DC=com"
To create a new Active Directory user, you can use PowerShell with the New-ADUser cmdlet.
Here’s a simple step-by-step example:
Import-Module ActiveDirectory
New-ADUser command:New-ADUser -Name "Jane Smith" -GivenName "Jane" -Surname "Smith" -SamAccountName "jsmith" -UserPrincipalName "[email protected]" -Path "OU=Sales,DC=yourdomain,DC=com" -AccountPassword (Read-Host -AsSecureString "Enter Password") -Enabled $true
Get-ADUser -Identity jsmith
Get-ADUser do?Get-ADUser is another PowerShell cmdlet used to retrieve information about Active Directory user accounts.
It can return specific user attributes, filter users, or list all users in an OU.
Examples:
Get-ADUser -Identity jsmith -Properties *
Get-ADUser -Filter * -SearchBase "OU=Sales,DC=yourdomain,DC=com"
Get-ADUser -Filter {Enabled -eq $false}