Get-EntraUserLicenseDetail
Retrieves license details for a user.
Syntax
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
Type: | System.String[] |
Aliases: | Select |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-UserId
The object ID of the user for which the license details are retrieved.
Type: | System.String |
Aliases: | ObjectId |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Inputs
System.String
Outputs
System.Object