Group Based Licensing with M365 Admin Center and Graph

Hi All,
I have two Groups that are used to assign M365 Licenses to Users.
Recently there was a change to move the Management from the Entra Admin Center to the M365 Admin Center
Entra Admin Center
In the Entra Admin Center you still can find the Groups


If you select the Group and click on “Licenses” you can see the Warning Message that informs you that the Management of the Licenses has now moved to M365 Admin Center.


You can still see the assigned Licensees an if you click on Products and see a readonly view of the assigned Service Plans


M365 Admin Center
In M365 Admin Center you have to go to Billing > Licenses


When you select the License you can see the assigned Users


If you click on Groups you can see the assigned License Group


When you select the Group you can manage the assigned Service Plans


Microsoft Graph
Connect to Microsoft Graph and List the Licensing Groups
Connect-MgGraph -Scopes Directory.ReadWrite.All, Group.ReadWrite.All, User.Read.All -NoWelcome
Get-MgGroup -Filter "startswith(displayName,'G-Lic')"


Show the Assigned Licenses of the Group. As you can see there is a SkuId and DisabledPlans for that Sku
Get-MgGroup -GroupId 6b121648-fbc9-44ad-acc5-1f6c76b6b7e9 -Property "AssignedLicenses" | Select-Object -ExpandProperty AssignedLicenses


Now we need to know what this SkuId is
Get-MgSubscribedSku | ft SkuId, SkuPartNumber, ServicePlans


Let’s list the ServicePlans of “STANDARDPACK”
$skus = Get-MgSubscribedSku | Select SkuId, SkuPartNumber, ServicePlans
$skus[14]
$skus[14].ServicePlans


Let’s add “Microsoft Boockings” to the Disabled Plans (199a5c09-e0ca-4e37-8f7c-b05d533e1ea2)
$Body = @{
addLicenses = @(
@{
disabledPlans = @(
"54fc630f-5a40-48ee-8965-af0503c1386e"
"40b010bb-0b69-4654-ac5e-ba161433f4b4"
"199a5c09-e0ca-4e37-8f7c-b05d533e1ea2"
)
skuId = "18181a46-0d4e-45cd-891e-60aabd171b4e"
}
)
removeLicenses = @()
}
Set-MgGroupLicense -GroupId 6b121648-fbc9-44ad-acc5-1f6c76b6b7e9 -BodyParameter $Body


Who is Member of the Group and who is that?
Get-MgGroupMember -GroupId 6b121648-fbc9-44ad-acc5-1f6c76b6b7e9
Get-MgUser -UserId e60b99f1-382f-4e71-846b-f0e5d42bfefd


Let’s check out the License Details of the User. You can see the SkuId and the Assigned Group including the Disabled Service Plans
#Group Based License
Get-MgUser -UserId e60b99f1-382f-4e71-846b-f0e5d42bfefd -Property Id, displayname, assignedLicenses, licenseAssignmentstates | Select-Object -ExpandProperty LicenseAssignmentStates | fl


As you can see the “Microsoft Bookings” Service Plan has been disabled


I have blogged here about Manage direct assigned Licenses and Service Plans with Microsoft.Graph
Here is an example of a user with Direct Assigned Licenses. Note that the AssignedGroup is Empty
#Direct Assigned License
Get-MgUser -UserId a.bohren@icewolf.ch -Property Id, displayname, assignedLicenses, licenseAssignmentstates | Select-Object -ExpandProperty LicenseAssignmentStates | fl


Regards
Andres Bohren

M365 Logo


PowerShell Logo
