Share via

Using Microsoft Graph PowerShell SDK to get remaining license count ?

EnterpriseArchitect 6,366 Reputation points
2022-07-26T06:38:01.247+00:00

People,

After reading: https://learn.microsoft.com/en-us/microsoft-365/enterprise/assign-licenses-to-user-accounts-with-microsoft-365-powershell?view=o365-worldwide

I wonder what's the command to get the remaining available License with Graph API ?

Get-MgSubscribedSku -All | Where SkuPartNumber -eq 'SPE_E5' | fl  

The result only the current usage of the license total, not the remaining available license.

Thanks in advance.

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Graph
0 comments No comments

Answer accepted by question author

  1. Rafael da Rocha 5,251 Reputation points
    2022-07-26T08:55:31.767+00:00

    You'll want to Expand the property PrepaidUnits, get the value of enabled and do the math "Enabled - Current Usage"

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.