M365 Service Plans mapping

A few days ago I posted how to create a list of all licensing SKUs and their ids.

That code was something along these lines:

That creates a hash table I can lookup:

Today I wanted to do the same for service plans. And also find the SKUs associated with a service plan.

Example usage (getting the service plan Id of “Exchange Online (Plan 2)” in “Office 365 E3”:

 

Now I can do the following:

The Skus key is an array.

Update (17th Sept 2024): The code was updated to add -replace"\?\?\?","" because it looks like the Product_Display_Name column appears as ???Product_Display_Name in the downloaded file.