Managing Microsoft 365 user licenses is an essential part of any IT admin's daily responsibilities. Whether you're auditing license assignments, troubleshooting access issues, or simply keeping track of usage, having visibility into individual user licenses is critical.
That’s where the Get-MgUserLicenseDetail cmdlet in Microsoft Graph PowerShell comes in.
The Get-MgUserLicenseDetail cmdlet retrieves detailed information about the Microsoft 365 licenses assigned to a specific user. This cmdlet provides insights, such as service plans included in the license and their status (Enabled/Disabled).
Get-MgUserLicenseDetail help IT administrators with the following:
Get-MgUserLicenseDetail -UserId <String>
Get-MgUserLicenseDetail -UserId "samadmin@7xh7fj.onmicrosoft.com"
This returns all assigned licenses along with service plan details for the specified user.
Get-MgUserLicenseDetail -UserId "1111-2222-4555-67676"
If you have the Azure AD Object ID, this method is equally effective.
To audit all user license details and export them into a CSV file:
$users = Get-MgUser
foreach ($user in $users){
Get-MgUserLicenseDetail -UserId $user.Id | Export-Csv -Path "WeeklyUserLicenseDetails.csv" -NoTypeInformation -Append
}
This script iterates through every user in your tenant and appends their license detail to a report file.
Get-MgUser shows whether a user is licensed but not what licenses they have. Get-MgUserLicenseDetail breaks down which licenses and services are assigned to the user.
Yes, as long as the email matches the UPN (UserPrincipalName), it works.
These are part of the license but have been manually turned off for that user.
Match the SKU ID or SKU Part Number from the output with Microsoft’s SKU documentation or use the Get-MgSubscribedSku cmdlet.
The Get-MgUserLicenseDetail cmdlet is your go-to PowerShell tool for license transparency across your Microsoft 365 environment. From troubleshooting to automation, it empowers you with the details that matter most—without needing to click through multiple admin portals.
If you're serious about license visibility and control, this cmdlet should be a core part of your scripting toolkit.
Did You Know? Managing Microsoft 365 applications is even easier with automation. Try our Graph PowerShell scripts to automate tasks like generating reports, cleaning up inactive Teams, or assigning licenses efficiently.
Ready to get the most out of Microsoft 365 tools? Explore our free Microsoft 365 administration tools to simplify your administrative tasks and boost productivity.
© Your Site Name. All Rights Reserved. Design by HTML Codex