How to unlock an AD account using PowerShell scripts

Most administrators use PowerShell commands to unlock all AD user accounts in their environment. However, the same operation of unlocking the locked AD accounts is much easier when done with ADManager Plus. The following is a comparison of the same operation with Windows PowerShell and ADManager Plus:

Windows PowerShell

Steps to unlock AD account using PowerShell:

  • Identify the domain in which you want to unlock user accounts
  • Identify the LDAP attributes you need modify.
  • Compile the script.
  • Execute it in Windows PowerShell.

Sample Windows PowerShell script to unlock AD user accounts

 Copied
Unlock-ADAccount -Identity "CN=Scott John,OU=Finance,OU=UserAccounts,DC=ABCCompany,DC=COM"
Click to copy entire script

ADManager Plus

How to unlock accounts in bulk:

  • Select Unlock Users -> User Management – Management
  • Select the domain and OU.
  • Choose the users you want to unlock or import a CSV file containing the user details and click Apply.

Screenshot

Unlock an Active Directory account using ADManager Plus

» Start 30-day Free Trial

Following are the limitations to unlock Active Directory user accounts using Windows PowerShell commands:

  • We can run this script only from the computers which has Active Directory Domain Services role.
  • With every filter, the script will get longer and complicated.
  • Troubleshooting these scripts requires extensive AD and scripting expertise

ADManager Plus can help you unlock AD users in bulk with just a CSV file in a simple and intuitively designed UI.

Manage AD user settings in bulk with ADManager Plus.

  Get 30-day free trial.
  • Embark on your script-free AD management, reporting, and automation journey with ADManager Plus.
  •  
     
  • By clicking 'Start your free trial now', you agree to processing of personal data according to the Privacy Policy.
  • Thanks
  • Your download should begin automatically in 15 seconds. If not, click here to download manually.

Related Powershell How-to Guides:

The one-stop solution toActive Directory Management and Reporting

Email Download Link