How to List Office 365 Subscriptions Using PowerShell
Subscriptions in Office 365 define the features and services available and how many licenses you have available to issue to user accounts. Each subscription has its own Account SKU ID such as ENTERPRISEPREMIUM for E3 subscriptions.
When you reference a subscription ID in PowerShell you will need to prefix it with your 365 tenant name. This is the part before your onmicrosoft.com address you chose when creating your account. Our test lab was created as office365laba.onmicrosoft.com so office365laba is our tenant name.
List Subscriptions
To return a list of available subscriptions and the number of licenses in your tenant run the following command:
Get-MsolAccountSku
If you want to return a more detailed list, you can add | FL to the command which will show all attributes associated with a returned object in a formatted list (FL).
Get-MsolAccountSku | FL
Summary
Making use of PowerShell with Office 365 gives us lots of scripting possibilities.
[email-download download_id=”9941″ contact_form_id=”9351″]Top Tip!
Use these cmdlet’s to write a script which alerts you when you have too many or not enough licenses.
If you want to learn more then you can buy my book from Amazon, either the paper back or kindle version. My advice is to buy the paperback version so you can keep it on your desk for easy reference!
For paperback version click here
2nd October 2018
Hello
I would like to know if it is possible by powershell to see if a user is licensed (true/false).
Then if true wouldn’t it be nice to know which type of licence the user has assigned ?
23rd October 2018
Get-MsolUser -All | where {$_.isLicensed -eq $true}
23rd October 2018
Nice one Ed! Completely missed the original comment. Many thanks for sharing.
25th February 2019
Great article! I was wondering if there is a script that shows which users are assigned to the particular subscription ID?
25th June 2019
Is it possible, if we can get the license expiration date using any script or command.