Why use this template?
Use this free PowerShell script when you need to export unlicensed member users. 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 User.Read.All. 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 unlicensed Entra users →How to use this result
Use this report to find member users whose assignedLicenses collection is empty without changing user or license assignments.
When this helps
- Review unlicensed member accounts before license cleanup, onboarding checks or account lifecycle work.
- Create a simple CSV of display name, UPN and enabled state for follow-up with service owners.
How to read the result
- A returned user is a Member account with no values in assignedLicenses at the time of the query.
- Unlicensed does not automatically mean unused, safe to disable or unnecessary; some accounts can still access services that do not require an assigned SKU.
Things to check
- Guest users are intentionally excluded by the Member filter.
- The report does not explain why a user is unlicensed or whether a license was recently removed.
What to do next: Confirm account ownership and business need before disabling users or changing license assignments.
Related tasks
Official references