How to get license details of a user in Microsoft Entra ID using Get-MgUserLicenseDetail

Getting license details of a user in Microsoft Entra ID

IT admins are often tasked with finding the license details of a user for compliance and audit purposes. While Graph PowerShell's Get-MgUserLicenseDetail command, an alternative to the Get-AzureADUserLicenseDetail command, can be used to obtain and export license details of a user in Microsoft Entra ID, its complexity and non-intuitive interface make it a challenging option. On the other hand, ADManager Plus, a Microsoft 365 management and reporting tool, simplifies the process, allowing admins to quickly generate and export the license details of a user in just a few clicks.

  • ADManager Plus
  • PowerShell
 

Find the license details of a user in Microsoft Entra ID using ADManager Plus

  1. Log in to ADManager Plus and navigate to Microsoft 365 > Reports > License Reports.
  2. Under General License Reports, click Licensed Users.
  3. Select the desired Microsoft 365 tenant from the Microsoft 365 Tenant drop-down list.
  4. Select the desired groups or domains whose users you would like to fetch in the Filter By pop-up and click Generate Now.
  5. The license details of a user can be viewed by clicking Details under the License Details column.
Get license details of a user in Microsoft Entra ID using ADManager Plus' predefined reports
 
 

Export reports in multiple formats, including HTML, CSV, and PDF.

 
 

Schedule automatic report generation.

 
 

Instantly assign or revoke Microsoft 365 licenses.

Get license details of a user in Microsoft Entra ID using Microsoft Graph PowerShell

Prerequisites

Before using the Get-MgUserLicenseDetail cmdlet, ensure the following:

  • The Microsoft Graph PowerShell module is installed. If not, install it using this script:
    Install-Module Microsoft.Graph -Scope CurrentUser
  • Connect to Microsoft Graph PowerShell with the required permissions to fetch a user's license details in Microsoft Entra ID with this script:
    Connect-MgGraph -Scopes "User.Read.All"

Using the Get-MgUserLicenseDetail command to get a user's license details in Microsoft Entra ID

The Get-MgUserLicenseDetail cmdlet can be used in Microsoft Graph PowerShell to fetch a user's license details in Microsoft Entra ID. Here's the syntax:

Get-EntraUserLicenseDetail
-UserId <String>
[-Property <String[]>]
[<CommonParameters>]

An example use case using the Get-MgUserLicenseDetail cmdlet

Listing the license details of a particular user

Get-MgUserLicenseDetail -UserId <'user_id'>

In this command, replace user_id with the user's ID for whom you would like to view the license details.

Supported parameters

The following table contains some parameters that can be used along with the Get-MgUserLicenseDetail command to fetch the license details of a user in Microsoft Entra ID efficiently.

Parameters Description
-UserId This parameter retrieves license details of a user based on their unique identifiers, such as user principal name or object ID.
-Property This parameter retrieves specific attributes of a user's license details.

Limitations of using Graph PowerShell scripts to get license details of a user in Microsoft Entra ID

  • Graph PowerShell requires IT admins to upgrade from Azure AD PowerShell and have familiarity with PowerShell scripting.
  • The Microsoft Graph API imposes throttling limits, which may affect performance when fetching license details of users in bulk.
  • The scripts may require extra effort to format and export data for reporting purposes.
  • Technical expertise is needed to troubleshoot errors.
  • The lack of an intuitive interface makes the overall experience less user-friendly, particularly for those new to scripting.

Highlights of using ADManager Plus to get license details of a user in Microsoft Entra ID

  • Intuitive interface that streamlines the report generation process.
  • Comprehensive and customizable reports with options to schedule and automate report generation.
  • Supports on-the-fly management actions to manage users instantly.
  • Optimized for large-scale environments and does not require any scripts for bulk operations.
  • Delegate tasks to technicians without elevating their native privileges.
  • Keep a watchful eye on your IT environment with more than 200 pre-packaged reports.
  • Export reports in various formats, such as CSV or HTML, in a few clicks.

Get the license details of a user in Microsoft Entra ID effortlessly with ADManager Plus

 
  • Fetch license details of a user in Microsoft Entra ID using ADManager Plus
  • Get license details of a user in Microsoft Entra ID using Microsoft Graph PowerShell
  • Limitations of using Graph PowerShell scripts to get license details of a user in Microsoft Entra ID
  • Highlights of using ADManager Plus to get license details of a user in Microsoft Entra ID
The one-stop solution to Active Directory Management and Reporting
Email Download Link