Get-UserLicense-Html
Azure AD: HTML report of a user's licenses
#Requires -Version 5.1
#Requires -Modules AzureAD
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[string]$UserObjectId
)
Process {
try {
$licenses = Get-AzureADUserLicenseDetail -ObjectId $UserObjectId -ErrorAction Stop | Select-Object SkuId, SkuPartNumber
Write-Output ($licenses | ConvertTo-Html -Fragment)
}
catch { throw }
}UPN or ObjectId of the user