Skip to content
Development
Command

/list-licenses

Show Microsoft 365 license inventory - available SKUs, consumed seats, and optimization opportunities

From plugin
msp-claude-plugins
52200 skills146 agents200 commands4 MCP
$ npx -y skills add wyre-ai/msp-claude-plugins --agent claude-code

Command definition

list-licenses.md
description: Show Microsoft 365 license inventory - available SKUs, consumed seats, and optimization opportunities
argument-hint: "[view] [sku]"
arguments: [view, sku]

List M365 Licenses

Show the current Microsoft 365 license inventory for the tenant, including seat utilization and optimization opportunities.

Conduit tools

The Conduit `m365` connector has no user, licence or MFA tools, so this command runs on the `cipp` and `microsoft-graph` connectors. The Graph requests further down show what each step reads; through Conduit, send a read as `microsoft_graph_get` with that path as `relativeUrl` (call `microsoft_graph_suggest_queries` first if unsure of the query), and perform writes through the CIPP tool named for that step.

| Step | Tool | Tier | |------|------|------| | Licence assignments and usage | `cipp_list_licenses` (`tenantFilter`) | read | | CSP subscriptions | `cipp_list_csp_licenses` | read | | Disabled or inactive users still holding seats | `cipp_list_users`, then `signInActivity` from the Graph users query in step 2 (`microsoft_graph_get`) for the 90-day check. Sign-in logs keep only about 30 days, so they cannot show 90 days of inactivity; treat a user with no `signInActivity` as unknown, not inactive. Combine the Graph data with CIPP's only after the tenant ID from `microsoft_graph_get` on `/v1.0/organization` matches the CIPP tenant; otherwise report it separately or leave it out | read / admin | | Remove all of a user's licences | `cipp_offboard_user` with `RemoveLicenses: true` only. This removes **every** assigned licence and also takes the user out of any group that assigns a licence, even with `RemoveGroups` off, which can remove access those groups grant. List those groups and confirm the scope before queuing it | admin | | Change one SKU | `cipp_edit_user` with `licenses` set to the **complete** list of SKUs the user should keep (CIPP adds missing SKUs and removes the rest) | admin |

Arguments

  • `view` (optional) — What to show: 'summary' (default), 'users' (per-user breakdown), 'unused' (reclaim candidates)
  • `sku` (optional) — Filter to a specific SKU name or partial match (e.g. "Business Premium")

Prerequisites

  • `Directory.Read.All` — list subscribed SKUs
  • `User.Read.All` — per-user license assignments
  • `AuditLog.Read.All` — sign-in activity for inactive user detection (optional)

Steps

1. **Get all subscribed SKUs**

   GET /v1.0/subscribedSkus?$select=skuPartNumber,skuId,consumedUnits,prepaidUnits,capabilityStatus

2. **For `--view users` or `--view unused`**: also fetch all users with licenses

   GET /v1.0/users?$select=id,displayName,userPrincipalName,accountEnabled,assignedLicenses,signInActivity&$top=999

3. **Calculate seat availability** per SKU: `prepaidUnits.enabled - consumedUnits`

4. **Identify optimization opportunities**:

  • Disabled users with licenses still assigned
  • Licensed users with no sign-in for 90+ days
  • SKUs with 0 remaining seats (may need expansion)

Output — Summary View

Microsoft 365 License Inventory — contoso.com
As of: 2024-01-15

SKU                                Purchased  Used   Available  Status
─────────────────────────────────────────────────────────────────────
Microsoft 365 Business Premium        50       46        4       ✅ OK
Entra ID P1                           25       22        3       ✅ OK
Microsoft 365 F1 (Frontline)          10        8        2       ✅ OK
Power BI Pro                          15       15        0       ⚠️  FULL

Total monthly spend estimate: ~$1,840/mo

Optimization Opportunities:
  ⚠️  3 disabled users still have M365 Business Premium (3 seats × $22/mo = $66/mo recoverable)
  ⚠️  Power BI Pro is at capacity — consider adding seats or auditing need
  💡  5 users inactive 90+ days — review for downgrade or removal

Output — Unused Licenses (`--view unused`)

License Reclaim Candidates — M365 Business Premium

Disabled accounts with licenses (immediate reclaim):
  ❌  jold@contoso.com         Disabled 2023-11-01   M365 Business Premium
  ❌  ftemp@contoso.com        Disabled 2023-12-15   M365 Business Premium
  ❌  test.user@contoso.com    Disabled 2024-01-01   M365 Business Premium

  → 3 licenses recoverable immediately

Inactive active accounts (last sign-in >90 days):
  🕐  msmith@contoso.com       Last login: 2023-09-10  M365 Business Premium
  🕐  jdoe@contoso.com         Last login: 2023-08-22  M365 Business Premium

  → 2 accounts to review — confirm with customer before removal

Estimated monthly saving if all reclaimed: $110/mo (5 seats × $22)

Output — Per-User View (`--view users`)

User License Assignments

Active Users:
  ✅  alice@contoso.com         M365 Business Premium
  ✅  bob@contoso.com           M365 Business Premium, Power BI Pro
  ✅  charlie@contoso.com       M365 F1 (Frontline)
  ...

Disabled Users (with licenses):
  ❌  jold@contoso.com          M365 Business Premium ← reclaim candidate

Error Handling

No Licenses Found

No licenses found in this tenant.
This may indicate a trial-only or CSP-managed tenant where licenses
are managed at the partner level.

Insufficient Permissions

Error: Directory.Read.All permission required to list SKUs.
User-level permissions insufficient — admin consent needed.

Related Commands

  • `/get-user` — Check a specific user's license assignments
  • `/check-mfa-status` — Ensure licensed users are properly secured
  • `/offboard-user` — Remove licenses during offboarding
Read more
@wyre-technology
Ships withmsp-claude-plugins

One command to supercharge Claude Code for MSP workflows. Then restart Claude Code. That's it. Documentation: mcp.wyre.ai

52200 skills146 agents4 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
52
Star history of wyre-technology/msp-claude-plugins on GitHub, a chart by star-history.com

Other commands on msp-claude-plugins.

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command