Licensing and Graph cmdlets

As a continuation to my previous two posts on Graph and licensing…

Recently we switched to E5 licenses. These include the PowerBI Pro licensing as a service plan, so there’s no need to assign the Power BI Pro license any more via its previous groups.

So my first task was to go through all our groups that have the E5 license applied and ensure they don’t disable Power BI Pro. I did that the following way:

First I get the SKU Id of the E5 license. Then I get the Service Plan ID of Power BI Pro.

Next I pull all the groups I am interested in (replace the <replace as needed> bit in the code). When pulling the info I also get the license assignments. And finally, for each group I get the E5 license, enumerate the disabled plans, and check if it contains the Power BI Pro plan. I output this along with the group name.

My next task was to go through all the groups that currently have the Power BI Pro license, double check that these users indeed have a Power BI Pro license assigned via a E5 license, and if not flag such users.

Last one. Some days ago I had to copy all the licenses assigned on one group to another. And also make ensure only the plans that are enabled in the source group are enabled on the destination group.