r/microsoft365 • • Jul 01 '26

[Solved] Microsoft 365 group-based licensing failing because old suspended SKUs were still assigned to the license group

I ran into a Microsoft 365 / Entra group-based licensing issue and wanted to document the root cause and fix in case someone else runs into the same thing. I also was wondering how the root cause could rancomly happen like this if there is any MS documentation anyboydy refere too where I could see the suspension of the below named SKU's

We have a security group called (Example):

M365-E5-License

Users in this group should automatically receive Microsoft 365 E5.

One user stayed under Errors & Issues when reprocessing the group-based license assignment.

The error was:

Subscription with SKU c7df2760-2c81-4ef7-b578-5b5392b571df does not have any available licenses.

The confusing part was that we still had available Microsoft 365 E5 licenses:

256 / 258 assigned
2 available

Also, when I manually assigned the user the Microsoft 365 E5 license, it worked.

So at first glance, it did not look like a capacity issue.

Root cause

The group was assigned to Microsoft 365 E5 / SPE_E5, but it also still had several old/suspended SKU assignments attached to the group.

The failing SKU:

c7df2760-2c81-4ef7-b578-5b5392b571df

mapped to:

ENTERPRISEPREMIUM

This is Office 365 E5, not the active Microsoft 365 E5 / SPE_E5 license.

The tenant had this state:

SkuPartNumber     SkuId                                ConsumedUnits Enabled Available CapabilityStatus
-------------     -----                                ------------- ------- --------- ----------------
ENTERPRISEPREMIUM c7df2760-2c81-4ef7-b578-5b5392b571df           256       0      -256 Suspended
SPE_E5            06ebc4ee-1bb5-47dd-8120-11324bc54e06           256     258         2 Enabled

So the active Microsoft 365 E5 license had 2 seats available, but the old ENTERPRISEPREMIUM SKU was suspended with 0 enabled seats.

The -256 available count was not extra capacity. It was:

Enabled - Consumed
0 - 256 = -256

Existing users still had the old suspended SKU assigned historically, but new/reprocessed users could no longer receive it.

Group assignment output

When checking the group assignment, I saw this:

GroupName    SkuPartNumber            SkuId                                CapabilityStatus Enabled Consumed Available DisabledPlans
---------    -------------            -----                                ---------------- ------- -------- --------- -------------
M365-E5-License EMSPREMIUM               b05e124f-c7cc-45a0-a6aa-8cf78c946968 Suspended              0      256      -256
M365-E5-License ENTERPRISEPREMIUM        c7df2760-2c81-4ef7-b578-5b5392b571df Suspended              0      256      -256
M365-E5-License M365_E5_SUITE_COMPONENTS 99cc8282-2f74-4954-83b7-c6a9a1999067 Suspended              0      256      -256
M365-E5-License SPE_E5                   06ebc4ee-1bb5-47dd-8120-11324bc54e06 Enabled              258      256         2
M365-E5-License WIN_DEF_ATP              111046dd-295b-4d6d-9724-d52ac90bd1f2 Suspended              0      256      -256
M365-E5-License WIN10_VDA_E5             488ba24a-39a9-4473-8ee5-19291e71b002 Enabled              258      256         2

The affected user showed this in LicenseAssignmentStates:

SkuId                                AssignedByGroup                      State Error          ErrorSubcode
-----                                ---------------                      ----- -----          ------------
c7df2760-2c81-4ef7-b578-5b5392b571df <GroupObjectId>                      Error CountViolation
b05e124f-c7cc-45a0-a6aa-8cf78c946968 <GroupObjectId>                      Error Other
99cc8282-2f74-4954-83b7-c6a9a1999067 <GroupObjectId>                      Error Other
488ba24a-39a9-4473-8ee5-19291e71b002 <GroupObjectId>                      Error Other
111046dd-295b-4d6d-9724-d52ac90bd1f2 <GroupObjectId>                      Error Other
06ebc4ee-1bb5-47dd-8120-11324bc54e06 <GroupObjectId>                      Error Other

The main/root error was:

ENTERPRISEPREMIUM = CountViolation

The other Error Other states appeared to be downstream errors caused by the failed SKU in the same group-based licensing assignment.

Scripts used

Connect to Microsoft Graph:

Connect-MgGraph -Scopes "Organization.Read.All","Group.Read.All","User.Read.All","Directory.Read.All"

Check the relevant SKUs:

$SkuFromError = [guid]"c7df2760-2c81-4ef7-b578-5b5392b571df" # ENTERPRISEPREMIUM / Office 365 E5
$SkuM365E5    = [guid]"06ebc4ee-1bb5-47dd-8120-11324bc54e06" # SPE_E5 / Microsoft 365 E5

Get-MgSubscribedSku -All |
Where-Object { $_.SkuId -in @($SkuFromError, $SkuM365E5) } |
Select-Object `
    SkuPartNumber,
    SkuId,
    ConsumedUnits,
    @{Name="Enabled";Expression={$_.PrepaidUnits.Enabled}},
    @{Name="Available";Expression={$_.PrepaidUnits.Enabled - $_.ConsumedUnits}},
    CapabilityStatus |
Format-Table -AutoSize

Check all license assignments on the group:

$GroupId = "<GroupObjectId>"

$skus = Get-MgSubscribedSku -All
$group = Get-MgGroup -GroupId $GroupId -Property Id,DisplayName,AssignedLicenses

$group.AssignedLicenses | ForEach-Object {
    $assignedLicense = $_
    $sku = $skus | Where-Object { $_.SkuId -eq $assignedLicense.SkuId }

    [PSCustomObject]@{
        GroupName        = $group.DisplayName
        SkuPartNumber    = $sku.SkuPartNumber
        SkuId            = $assignedLicense.SkuId
        CapabilityStatus = $sku.CapabilityStatus
        Enabled          = $sku.PrepaidUnits.Enabled
        Consumed         = $sku.ConsumedUnits
        Available        = $sku.PrepaidUnits.Enabled - $sku.ConsumedUnits
        DisabledPlans    = $assignedLicense.DisabledPlans -join ","
    }
} | Sort-Object SkuPartNumber | Format-Table -AutoSize

Check the affected user’s group-based licensing state:

$user = Get-MgUser -UserId "user@domain.com" -Property Id,DisplayName,UserPrincipalName,LicenseAssignmentStates

$user.LicenseAssignmentStates |
Select-Object `
    SkuId,
    AssignedByGroup,
    State,
    Error,
    ErrorSubcode |
Format-Table -AutoSize

Backup the current group license assignment before changing anything:

$GroupId = "<GroupObjectId>"
$BackupPath = "C:\Temp\M365-E5-License-AssignedLicenses-BeforeChange.json"

$group = Get-MgGroup -GroupId $GroupId -Property Id,DisplayName,AssignedLicenses

$group.AssignedLicenses |
ConvertTo-Json -Depth 10 |
Out-File $BackupPath -Encoding utf8

Write-Host "Backup saved to $BackupPath"

Remove only the suspended SKUs from the group assignment:

$GroupId = "<GroupObjectId>"

$SuspendedSkuIds = @(
    "111046dd-295b-4d6d-9724-d52ac90bd1f2", # WIN_DEF_ATP
    "99cc8282-2f74-4954-83b7-c6a9a1999067", # M365_E5_SUITE_COMPONENTS
    "c7df2760-2c81-4ef7-b578-5b5392b571df", # ENTERPRISEPREMIUM
    "b05e124f-c7cc-45a0-a6aa-8cf78c946968"  # EMSPREMIUM
)

Set-MgGroupLicense `
    -GroupId $GroupId `
    -AddLicenses @() `
    -RemoveLicenses $SuspendedSkuIds

Verify the group assignment afterward:

$GroupId = "<GroupObjectId>"

$skus = Get-MgSubscribedSku -All
$group = Get-MgGroup -GroupId $GroupId -Property Id,DisplayName,AssignedLicenses

$group.AssignedLicenses | ForEach-Object {
    $assignedLicense = $_
    $sku = $skus | Where-Object { $_.SkuId -eq $assignedLicense.SkuId }

    [PSCustomObject]@{
        GroupName        = $group.DisplayName
        SkuPartNumber    = $sku.SkuPartNumber
        SkuId            = $assignedLicense.SkuId
        CapabilityStatus = $sku.CapabilityStatus
        Enabled          = $sku.PrepaidUnits.Enabled
        Consumed         = $sku.ConsumedUnits
        Available        = $sku.PrepaidUnits.Enabled - $_.ConsumedUnits
        DisabledPlans    = $assignedLicense.DisabledPlans -join ","
    }
} | Sort-Object SkuPartNumber | Format-Table -AutoSize

Check whether any other groups still assign the suspended SKUs:

$SuspendedSkuIds = @(
    [guid]"111046dd-295b-4d6d-9724-d52ac90bd1f2", # WIN_DEF_ATP
    [guid]"99cc8282-2f74-4954-83b7-c6a9a1999067", # M365_E5_SUITE_COMPONENTS
    [guid]"c7df2760-2c81-4ef7-b578-5b5392b571df", # ENTERPRISEPREMIUM
    [guid]"b05e124f-c7cc-45a0-a6aa-8cf78c946968"  # EMSPREMIUM
)

Get-MgGroup -All -Property Id,DisplayName,AssignedLicenses |
Where-Object {
    $groupSkuIds = $_.AssignedLicenses.SkuId
    @($SuspendedSkuIds | Where-Object { $groupSkuIds -contains $_ }).Count -gt 0
} |
Select-Object Id,DisplayName |
Format-Table -AutoSize

Check if users still have group-based licensing errors:

$GroupId = "<GroupObjectId>"
$members = Get-MgGroupMember -GroupId $GroupId -All

foreach ($member in $members) {
    $u = Get-MgUser -UserId $member.Id -Property DisplayName,UserPrincipalName,LicenseAssignmentStates

    $errors = $u.LicenseAssignmentStates | Where-Object {
        $_.AssignedByGroup -eq $GroupId -and $_.Error -ne "None"
    }

    foreach ($err in $errors) {
        [PSCustomObject]@{
            DisplayName       = $u.DisplayName
            UserPrincipalName = $u.UserPrincipalName
            SkuId             = $err.SkuId
            State             = $err.State
            Error             = $err.Error
            ErrorSubcode      = $err.ErrorSubcode
        }
    }
} | Format-Table -AutoSize

Solution

I removed the suspended SKU assignments from the group:

WIN_DEF_ATP
111046dd-295b-4d6d-9724-d52ac90bd1f2

M365_E5_SUITE_COMPONENTS
99cc8282-2f74-4954-83b7-c6a9a1999067

ENTERPRISEPREMIUM
c7df2760-2c81-4ef7-b578-5b5392b571df

EMSPREMIUM
b05e124f-c7cc-45a0-a6aa-8cf78c946968

After that, the group only kept the active/current SKU assignments, including:

SPE_E5
06ebc4ee-1bb5-47dd-8120-11324bc54e06

The important part was that I did not remove the entire license group assignment. I only removed the suspended SKUs from the group.

Conclusion

If group-based licensing says there are no licenses available, but the Microsoft 365 admin center shows available seats, check the exact SKU ID in the error.

In my case, the available seats were for:

SPE_E5 / Microsoft 365 E5

But the error was for:

ENTERPRISEPREMIUM / Office 365 E5

That old SKU was suspended and still attached to the group assignment.

Removing the suspended legacy SKUs from the group fixed the root cause without having to remove the full group-based Microsoft 365 E5 assignment.

6 Upvotes

1 comment sorted by