
Microsoft 365
The M365 Licensing Audit Nobody Wants to Do
Automated M365 licensing audit using Graph API and PowerShell: find unused Copilot seats and reclaim licences from disabled accounts still on E5.
By Paul Bentley14 min read
On this page
- Why the admin centre isn't enough
- Setting up Graph access
- Step 1: pull the licence inventory
- Step 2: map per-user licence assignments
- Finding waste pattern 1: disabled accounts with licences
- Finding waste pattern 2: service accounts on full licences
- Finding waste pattern 3: guest users with licences
- Step 3: cross-reference against usage
- Finding waste pattern 4: E5 users using only E3 features
- Finding waste pattern 5: Copilot licences with no adoption
- Step 4: produce the waste report
- Step 5: the structural fixes
- Automate licence reclamation on account disable
- Move to group-based licensing
- Schedule the audit
- Step 6: building the licence waste dashboard
- The SharePoint list schema
- The Azure Automation runbook
- The Power BI dashboard
- DAX measures
- Scheduled refresh
- What this doesn't cover (yet)
Every Microsoft 365 tenant I've assessed has been overspending on licences. Not by a little: typically 15 to 30%, sometimes more. The waste follows the same patterns every time: E5 licences on service accounts that don't need them, Copilot seats assigned to mailboxes that send three emails a month, Defender P2 entitlements on users who aren't in scope for EDR, and the perennial favourite, disabled accounts that still hold paid licences because nobody told HR to tell IT to tell the licence admin to reclaim them.
The audit isn't hard. It doesn't get done because it's tedious, it's nobody's explicit responsibility, and the M365 Admin Centre makes it just difficult enough to cross-reference usage against assignment that most people give up after an afternoon of clicking.
This post fixes that. We'll use Microsoft Graph API to pull licence inventory, per-user assignments, and workload activity data, then cross-reference them to produce a waste report you can hand to your finance team. Everything runs in PowerShell, every script is reusable, and the whole process takes about twenty minutes once you've set it up. If you're new to working with Graph API programmatically, the Microsoft Graph API for Architects post covers endpoint selection, authentication patterns, and PowerShell fundamentals for tenant assessments.