entra_find_stale_accounts
Identify inactive Microsoft 365 accounts and the unused licenses they hold, showing how many seats can be reclaimed. Disabled accounts with licenses appear first as pure waste.
Instructions
Find accounts that have not signed in recently and the licences they hold.
Answers "which licences are we paying for that nobody uses?". Joins the user list, sign-in activity and the licence SKUs, and reports how many seats could be reclaimed, broken down by product. Disabled accounts that still hold a licence are listed first — they are pure waste.
Requires User.Read.All and AuditLog.Read.All. Sign-in activity also needs Microsoft Entra ID P1 or higher on the tenant; without it, Graph does not expose this data at all and the tool will say so.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Minimum days since the last successful sign-in for an account to count as stale. | |
| licensed_only | No | Only accounts holding at least one licence. True answers 'what are we paying for'; false answers 'what should be cleaned up'. | |
| include_never_signed_in | No | Include accounts with no recorded sign-in. Turn off to filter out service accounts, which never sign in interactively. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |