Finding the locked-out account
If password policies are defined, accounts with a large number of login failures will be locked out. Locked-out accounts in an AD environment can be found using the following command:
Search-ADAccount -Lockedout | Select name,samAccountName,Lockedout
If any of those in the list need to be unlocked, we can use the Unlock-ADAccount
cmdlet to unlock an account.
For an individual account, perform the following command:
Unlock-ADAccount tuser4
For all the accounts on the list, perform the following command:
Search-ADAccount -Lockedout | Unlock-ADAccount
It is not a good practice to unlock all the accounts unless there is a specific reason.