Using Microsoft Graph PowerShell SDK to get remaining license count ?

EnterpriseArchitect 4,741 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.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,592 questions
Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,364 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rafael da Rocha 5,076 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