Why use this template?
Use this free PowerShell script when you need to find currently locked-out user accounts. It is generated locally and can be reviewed before you run it yourself in your own PowerShell session.
The template uses ActiveDirectory and requires Directory read access. Output: CSV report. Level: Intermediate. Action: Read-only. Risk: Low.
Review before running
The script is generated in your browser. Read it before you run it, and test it outside production first. “Read-only” describes the script itself; anything you add around it can still change data.
Generate the script
- Open the template in the PowerShell Builder.
- Enter the requested values and review the module, permissions, output and risk.
- Generate the script, read it carefully, and test it outside production before use.
The script is generated locally in your browser. Nothing needs to be uploaded to Opselith.
Generate Find locked-out AD users →How to use this result
Use this report to list Active Directory user accounts that are currently in a locked-out state.
When this helps
- Create a quick lockout report during helpdesk or authentication troubleshooting.
- Export locked users to CSV when several accounts need follow-up.
- Confirm whether an account is currently locked before using a separate unlock process.
How to read the result
- The template uses Search-ADAccount with LockedOut and UsersOnly, so the result is limited to user accounts reported as currently locked.
- LastLogonDate is included as context but is not the lockout timestamp and should not be used to determine when the lockout occurred.
Things to check
- This script identifies locked accounts; it does not identify the device, service or bad credential that caused repeated authentication failures.
- The report is read-only and does not unlock accounts. Investigate the cause before using a separate unlock action.
What to do next: Confirm the user and investigate the lockout source, then use your normal approved process if the account should be unlocked.
Related tasks
Official references