Why use this template?
Use this PowerShell template when you need to find disabled users that still have recent sign-in activity. It is generated locally and can be reviewed before you run it yourself in your own PowerShell session.
The template uses Microsoft.Graph.Users and requires AuditLog.Read.All; User.Read.All; Microsoft Entra ID P1/P2 for signInActivity details. Output: CSV report. Level: Advanced. 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 disabled Entra users with recent sign-in →How to use this result
Use this report to flag currently disabled accounts that also have a recent LastSuccessfulSignInDateTime value.
When this helps
- Investigate disabled accounts that still show recent successful activity in the available sign-in history.
- Add a focused exception check to account-offboarding or access-review work.
How to read the result
- The script compares current AccountEnabled=false with LastSuccessfulSignInDateTime inside the selected period.
- A match does not prove the successful sign-in happened after the account was disabled because this report does not correlate a disable-event timestamp.
Things to check
- Microsoft documents limitations and reporting delay for signInActivity; blank or delayed values should be treated as unknown rather than proof of inactivity.
- Investigate the sign-in event and account change history before treating a row as a control failure.
What to do next: Correlate the account with sign-in logs and audit history to establish event order before remediation.
Related tasks
Official references