Edit

Share via


Get-EntraUserLicenseDetail

Retrieves license details for a user.

Syntax

Default (Default)

Get-EntraUserLicenseDetail

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

Description

This cmdlet retrieves a user's license details.

In delegated scenarios with work or school accounts, the signed-in user needs a supported Microsoft Entra role or a custom role with the microsoft.directory/users/licenseDetails/read permission. The following least privileged roles support this operation:

  • Guest Inviter
  • Directory Readers
  • Directory Writers
  • License Administrator
  • User Administrator

In delegated scenarios with work or school accounts, the signed-in user needs a supported Microsoft Entra role or a custom role with the microsoft.directory/users/licenseDetails/read permission. The following least privileged roles support this operation:

  • Guest Inviter
  • Directory Readers
  • Directory Writers
  • License Administrator
  • User Administrator

Examples

Example 1: Retrieve user license details

Connect-Entra -Scopes 'User.Read.All'
Get-EntraUserLicenseDetail -UserId 'SawyerM@contoso.com'
Id                                          SkuId                                SkuPartNumber
--                                          -----                                -------------
X8Wu1RItQkSNL8zKldQ5DiH6ThjDmF1OlavQcFOpbmc aaaaaaaa-0b0b-1c1c-2d2d-333333333333 INFORMATION_PROTECTION_COMPLIANCE
X8Wu1RItQkSNL8zKldQ5Dk8SXrDMx6BFpqqM94yUaWg bbbbbbbb-1c1c-2d2d-3e3e-444444444444 EMSPREMIUM
X8Wu1RItQkSNL8zKldQ5DmAn38eBLPdOtXhbU5K1cd8 cccccccc-2d2d-3e3e-4f4f-555555555555 ENTERPRISEPREMIUM

This example demonstrates how to retrieve license details for a user from Microsoft Entra ID.

Parameters

-Property

Specifies properties to be returned

Parameter properties

Type:

System.String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Select

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-UserId

The object ID of the user for which the license details are retrieved. Specifies the ID of a user's UserPrincipalName or UserId in Microsoft Entra ID.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ObjectId, UPN, Identity, UserPrincipalName

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

System.String

Outputs

System.Object