Unlocking a user account on a specified Domain Controller

by [Published on 20 Aug. 2015 / Last Updated on 20 Aug. 2015]

Tip explains use of Unlock-ADAccount on a specified domain controller

You can use Active Directory Users and Computers snap-in to unlock an user account. In case you do not know the name of the domain controller where the user account got locked, you need to connect to each domain controller using Active Directory Users and Computers and then unlock the user account. Unlock-ADAccount PowerShell cmdlet can help you unlock user account on all domain controllers.

Steps:

  1. Create a Text file.
  2. Specify all the domain controllers in it.
  3. Run below command to unlock an user account on all domain controllers.
  • For /F "Tokens=*" %L IN (DCList.TXT) DO Unlock-ADAccount NickS -Server %L

Above command unlocks user account named NickS all domain controllers specified in the DCList.TXT file.

About Nirmal Sharma

Nirmal is a MCSEx3, MCITP and was awarded Microsoft MVP award in Directory Services and Windows Networking. He is specialized in Directory Services, Failover cluster, Hyper-V, System Center, Windows Azure, and Exchange Servers and has been involved in Microsoft Technologies since 1994. In his spare time, he offers technical help by writing tips and articles on several web sites. Nirmal can be reached at nirmal_sharma@mvps.org.

 

See Also


The Author — Nirmal Sharma

Nirmal Sharma avatar

Nirmal Sharma is a MCSEx3, MCITP, and was awarded Microsoft MVP in Directory Services. In his spare time, he likes to help others and share some of his knowledge by writing tips and articles for various online communities. Nirmal can also be found contributing to PowerShell based Dynamic Packs for ADHealthProf.ITDynamicPacks.Net solutions.