Get-MgSubscribedSku
Use Get-MgSubscribedSku to compare purchased and consumed Microsoft 365 license units. See Microsoft.Graph module requirements and examples.
Documentation: Microsoft Learn — Get-MgSubscribedSku
Common usage
Get-MgSubscribedSku -ErrorAction StopThis is a usage example, not the complete parameter-set reference. Follow Microsoft Learn below for supported parameters and version details.
See the command anatomy
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Get-MgSubscribedSku -ErrorAction Stop- Stage 1Get-MgSubscribedSku
-ErrorAction
Try it
PowerShell example · browser support is limited.
Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.
Follow the objects
Run the command to inspect each stage.
Examples
Get-MgSubscribedSku -ErrorAction Stop
Get-MgSubscribedSku -ErrorAction StopShow reference output
Sample output · fictional data, shaped like the real thing
SkuPartNumber ConsumedUnits CapabilityStatus SkuId ------------- ------------- ---------------- ----- SPE_E5 118 Enabled 06ebc4ee-1bb5-47dd-8120-11324bc54e06 POWER_BI_PRO 24 Enabled f8a1db68-be16-40ed-86d5-cb42ce701560
Practical use and troubleshooting
Practical scenario: Use Get-MgSubscribedSku when you need to compare purchased and consumed Microsoft 365 license units. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.
Common error and fix: Insufficient privileges needs checking the API's documented read permissions and the consent granted to the current session. Do not interpret a failed query as zero purchased licences. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.
See also: Get-MgUser. Get-MgSubscribedSku reports tenant subscription SKUs and consumed units; Get-MgUser reads user objects. Tenant-level licence totals do not identify which users received direct or group-based assignments. Read the linked command before substituting it; similar names do not imply identical inputs or output.
Recap
Get-MgSubscribedSku Use Get-MgSubscribedSku to compare purchased and consumed Microsoft 365 license units. See Microsoft.Graph module requirements and examples.
Next: Get-MgAuditLogSignIn