Managing Active Directory user accounts efficiently is crucial for maintaining security and usability within an organization. This PowerShell script allows administrators to bulk enable user accounts that may have been disabled, making it easier to manage user access as needed. At ServerEngine, we provide powerful tools to streamline your server management tasks.
powershell
Import-Module ActiveDirectory
function Enable-ADUserAccounts {
param (
[string]$csvPath
)
$users = Import-Csv -Path $csvPath
foreach ($user in $users) {
$username = $user.UserName
try {
Enable-ADAccount -Identity $username
Write-Host "Successfully enabled user: $username"
} catch {
Write-Host "ERROR: Could not enable user: $username. Error: $_"
}
}
}
Enable-ADUserAccounts -csvPath "C:\Path\To\Your\enable_users.csv"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.