Simplified User Account Creation in Active Directory with PowerShell
In this post, we will provide a PowerShell script that simplifies the process of creating user accounts in Active Directory. This script streamlines the onboarding of new employees by allowing administrators to quickly add users with predefined attributes such as job title and department. By automating user account creation, organizations can improve efficiency and reduce the chances of errors during the onboarding process. Here is the PowerShell script for creating user accounts in Active Directory:
# Import the Active Directory module
Import-Module ActiveDirectory
# Define user details
$userFirstName = "Sarah"
$userLastName = "Williams"
$userName = "sarah.williams"
$userPassword = ConvertTo-SecureString "YourSecurePasswordHere" -AsPlainText -Force
$userOU = "OU=Employees,DC=yourdomain,DC=com" # Update to your organizational unit
# Create the new user in Active Directory
New-ADUser -Name "$userFirstName $userLastName" `
-GivenName $userFirstName `
-Surname $userLastName `
-SamAccountName $userName `
-UserPrincipalName "[email protected]" `
-Path $userOU `
-AccountPassword $userPassword `
-Enabled $true `
-PassThru
Write-Host "User $userFirstName $userLastName has been successfully created in Active Directory."Run it across your fleet
This script runs as-is on a single host. Paste it into ServerEngine to schedule it, run it on a whole server group in parallel, and keep the credentials out of the file — see the scripts documentation and the credential store.
More in Active Directory
Active Directory User Onboarding with PowerShell
2026-08-17Active Directory User Offboarding with PowerShell
2026-08-17Disable an Active Directory User with PowerShell
2026-08-17Enable an Active Directory User with PowerShell
2026-08-17Unlock an Active Directory Account with PowerShell
2026-08-17Reset an Active Directory Password with PowerShell
2026-08-17Ready when you are.
Try ServerEngine free for 7 days.