Why use this template?
Use this free PowerShell script when you need to export disabled users. 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: Beginner. 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 Export disabled AD users →How to use this result
Use this report to create a CSV inventory of Active Directory user accounts whose Enabled property is currently false.
When this helps
- Review disabled accounts before a cleanup, migration or retention decision.
- Compare disabled accounts with HR, ownership or ticket records.
- Capture account identity, email, object change date and last logon date in one repeatable report.
How to read the result
- Each row is a user whose Enabled property is false at query time.
- WhenChanged is the directory object modification timestamp and is not a reliable record of when the account was disabled. LastLogonDate is also approximate because it is based on replicated logon data.
Things to check
- Do not calculate account-disable age from WhenChanged alone because other attribute changes can update that timestamp.
- Disabled accounts can still be intentionally retained for legal, recovery, shared-resource or operational reasons. Confirm ownership and retention requirements before deletion.
What to do next: Compare the disabled-user CSV with your authoritative ownership or HR source and review the oldest or unexplained accounts first.
Related tasks
Official references