Table of Contents
Translate Microsoft 365 License GUIDs to Product Names
Working with Microsoft 365 and Entra ID licenses and understanding them can be quite the task for many system administrators. Did you know that the official Microsoft Learn article lists more than 3230 different SKU IDs and names as of June 1st 2023?
The problem is that Graph or PowerShell Modules never return a product name that actually means something to an admin. The names you’ll see there are not the same ones we’re used to from the Azure or M365 Admin Portals.
Let’s take a look at what the subscribedSkus that Graph PowerShell returns. This is how we get a list of all SKUs a tenant is subscribed to.
PS P:\> $skus = Get-MgSubscribedSku -All | select SkuPartNumber, SkuId, ConsumedUnits
PS P:\> $skus
SkuPartNumber SkuId ConsumedUnits
------------- ----- -------------
EMSPREMIUM b05e124f-c7cc-45a0-a6aa-8cf78c946968 19
ENTERPRISEPREMIUM c7df2760-2c81-4ef7-b578-5b5392b571df 0
ENTERPRISEPACK 6fd2c87f-b296-42f0-b197-1e91e994b900 0
FLOW_FREE f30db892-07e9-47e9-837c-80727f46fd3d 1
Win10_VDA_E3 6a0f6da5-0b87-4190-a6ae-9bb5a2b9546a 19
ENTERPRISEPREMIUM_NOPSTNCONF 26d45bd9-adf1-46cd-a9e1-51e9a5524128 19
INFORMATION_PROTECTION_COMPLIANCE 184efa21-98c3-4e5d-95ab-d07053a96e67 19
Or you can call to this Graph endpoint to get the list of subscriptions.
GET https://graph.microsoft.com/v1.0/subscribedSkus
The skuPartNumber is what Microsoft calls String ID on their learn article. As we all know, Microsoft is no stranger to changing or rebranding product names. We have never seen them change a skuPartNumber though.
What’s really nice is that Microsoft also provides a download link to a CSV file which contains all the SKUs, Ids and names. If it can be downloaded by using a browser, it can also be downloaded by PowerShell.
$skus = Get-MgSubscribedSku -All
Invoke-WebRequest -Uri "https://download.microsoft.com/download/e/3/e/e3e9faf2-f28b-490a-9ada-c6089a1fc5b0/Product%20names%20and%20service%20plan%20identifiers%20for%20licensing.csv" -OutFile "$env:temp\LicenseNames.csv"
$translationTable = Import-Csv "$env:temp\LicenseNames.csv"
The SKU information retrieved by graph is already in our $skus variable. So, all that’s left to do is a simple one-liner to search the $translationTable.GUID for a matching $sku.skuId .
$skuNamePretty = ($translationTable | Where-Object {$_.GUID -eq $sku.skuId} | Sort-Object Product_Display_Name -Unique).Product_Display_Name
This process will convert the skuPartNumber into the recognizable License name commonly seen in the Microsoft 365 admin center.
PS P:\> $skuNamePretty
Microsoft 365 E5 Compliance
We have combined all the previous code snippets to create a slightly more advanced, yet still fundamental script that outputs a table listing all the available license names.
$skus = Get-MgSubscribedSku -All
Invoke-WebRequest -Uri "https://download.microsoft.com/download/e/3/e/e3e9faf2-f28b-490a-9ada-c6089a1fc5b0/Product%20names%20and%20service%20plan%20identifiers%20for%20licensing.csv" -OutFile "$env:temp\LicenseNames.csv"
$translationTable = Import-Csv "$env:temp\LicenseNames.csv"
$output = @()
foreach ($sku in $skus) {
$skuNamePretty = ($translationTable | Where-Object {$_.GUID -eq $sku.skuId} | Sort-Object Product_Display_Name -Unique).Product_Display_Name
$skuDetails = [PSCustomObject][Ordered]@{
LicenseName = $skuNamePretty
SkuPartNumber = $Sku.SkuPartNumber
SkuId = $Sku.SkuId
ActiveUnits = $Sku.PrepaidUnits.Enabled
ConsumedUnits = $Sku.ConsumedUnits
}
$output += $skuDetails
}
$output | Out-GridView -Title "License Names"
The output will look like this.
As far as we understand, the download URL of the CSV should not be changed once a new version is uploaded. We verified this by viewing GitHubs commit history for that article.
As you can see, even though the date in the note was updated, the URL stayed the same. That’s why it should be safe to assume that we won’t need to update that URL in any script where we download that list.
To make the PowerShell script cleaner, we’ve created a script, all you need to do is insert the below line into your script.
irm https://bonguides.com/pw/lictranslator | iex
# Output
LicenseName SkuPartNumber SkuId ActiveUnits ConsumedUnits
----------- ------------- ----- ----------- -------------
Microsoft 365 Business Premium SPB cbdc14ab-d96c-4c30-b9f4-6ada7cdc1d46 25 1
Microsoft Fabric (Free) POWER_BI_STANDARD a403ebcc-fae0-4ca2-8c8c-7a907fd6c235 9999 0
Output options to graphical grid view or export to CSV file.
iex "& { $(irm https://bonguides.com/pw/lictranslator) } -OutCSV"
iex "& { $(irm https://bonguides.com/pw/lictranslator) } -OutGridView"
Conclusion
Thanks to the CSV file provided by Microsoft, our scripts can consistently retrieve the latest data and convert any license GUID into a more recognizable format. We hope this assists you in creating more robust and improved scripts for managing licensing in MS Graph or PowerShell.
Not a reader? Watch this related video tutorial: