Checking for Available Licences in Office365 via Powershell

You should have the sign-in assistant and the Azure AD Module for Powershell already installed and be connected (connect-msolservice).

You’ll need to know what SKU you’re looking to check


I’ll be working with  E1’s, and will throw it into a variable:

$accountsku = “megacorpinc:EXCHANGESTANDARD”

Once we have that, we’re ready to pull active and consumed units:

$activeunits = (Get-MsolAccountSku | where {$_.AccountSkuId -eq $accountsku}).ActiveUnits

$consumedunits = (Get-MsolAccountSku | where {$_.AccountSkuId -eq $accountsku}).ConsumedUnits

Then take the difference…

$availableunits = $activeunits – $consumedunits

And there you have it.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s