Skip to main content
AD Academy
Back to all recipes
Level: JuniorLast updated:

Find every locked account and unlock it

Search-ADAccount -LockedOut | Select-Object Name,SamAccountName,LastLogonDate
Search-ADAccount -LockedOut | Unlock-ADAccount

Why it works this way

Monday morning brings a lockout wave. One list beats hunting one by one.

Watch out

  • Before unlocking everyone, rule out password spraying (many 4625 from one source).
  • The lockout source is on the PDC Emulator, event 4740.

Related events

Similar recipes