Tracking license usage helps cut costs and reclaim unused licenses. While Graph PowerShell’s Get-MgSubscribedSku helps fetch Microsoft 365 license data, it requires precise commands and filter syntax. On the other hand, ADManager Plus, a Microsoft 365 management and reporting tool , simplifies license usage tracking with a visual interface that lets you generate and filter reports without any scripts.
Before using the Get-MgSubscribedSku cmdlet, make sure the following prerequisites are met:
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "Organization.Read.All"
The Get-MgSubscribedSku cmdlet can be used in Microsoft Graph PowerShell to get subscribed Microsoft 365 licenses.
Here's the syntax:
Get-MgSubscribedSku
[-Property <String[ ]>]
[-ExpandProperty <String[ ]>]
[-Filter <String>]
[-Search <String>]
[-Skip <Int32>]
[-Sort <String[ ]>]
[-Top <Int>]
[-ResponseHeadersVariable <String>]
[-Headers <IDictionary>]
[-PageSize <Int32>]
[-All]
[-CountVariable <String>]
[<CommonParameters>]
The following table contains some parameters that can be used along with the Get-MgSubscribedSku command to efficiently get subscribed Microsoft 365 licenses.
| Parameter | Description |
|---|---|
| -UserId | Specifies the user (by UPN or Object ID) whose licenses are being updated. |
| -AddLicenses | An array of license objects to assign. Each object must include at least the Sku ID. You can also specify disabled plans inside. |
| -RemoveLicenses | An array of license SKU IDs to remove from the user. |
| -AdditionalProperties | Used to pass any extra parameters in the request body that the API supports. |
| -ResponseHeadersVariable | Stores response headers in a variable. Useful for logging or debugging. |
| -Headers | Custom HTTP headers if needed during the request. |
| -WhatIf | Simulates the command without making any changes. |
| -Confirm | Prompts you to confirm before applying changes. |