Powershell Script to Get Office 365 License Report

Posted on

Sometimes we need to know what type of office 365 license are being used by our users especially after addition of new users, license removal because of user resign, downgrade/upgrade to meet the user requirement, etc. By knowing exactly office 365 license allocation it will not only look organized and easier to us to manage but will prevent us to spend unnecessary money for allocating the wrong type of license. For example: there is case when a user is using E1+ Microsoft office 2010 but they registered as E3 user, this is really waste of money, why don’t we downgrade the license to E1 and install office 2010 and pay less to Microsoft for the license.

I found a script from microsoft site https://gallery.technet.microsoft.com/scriptcenter/Export-a-Licence-b200ca2a

To run this script you have to first install windows azure active directory for windows powershell form here

32-bit Azure Active Directory Module for Windows PowerShell (32-bit version) I am using this version on this article but this version already expired for support since October 20, 2014.

64 bit Azure Active Directory Module for Windows PowerShell (64-bit version), and click Run to run the installer package.

After you install Azure AD module and already download get-msoluserlicence.ps1 file, run it from Start-All Programs-Windows Azure Active Directory and click Windows Azure Directory Module.

On PS prompt you enter command ./get-msoluserlicense.ps1

Powershell To Get Office 365 License

Enter credential (your email+password)

enter office365 credential - Powershell To Get Office 365 License

You will see the result on Office_365_licenses.csv file

powershell running script - Powershell To Get Office 365 License

 

result file - Powershell To Get Office 365 License

This information on column C (AccountSku) and D(INTUNE_O365) are information you are looking for and it really useful to know exactly office365 license allocation to our users.

The other option is to run below command on windows Azure Active Directory prompt:

./Get-MsolUser -All | ft displayname , Licenses | Out-File c:\users.csv

Script command is from http://www.amintavakoli.com/2013/07/powershell-command-to-get-list-of.html

The script and report is quite simple, but i prefer using no 1 above, this must run under Azure Active Directory Module as well.

another get office 365 script - Powershell To Get Office 365 License

result after running script - Powershell To Get Office 365 License

Where STANDARDPACK is E1 and ENTERPRISEPACK is E3

Complete list of code:

DESKLESSPACK is Office 365 (Plan K1)

DESKLESSWOFFPACK is Office 365 (Plan K2)

LITEPACK is Office 365 (Plan P1)

EXCHANGESTANDARD is Office 365 Exchange Online Only

STANDARDPACK is Office 365 (Plan E1)

STANDARDWOFFPACK is Office 365 (Plan E2)

ENTERPRISEPACK is Office 365 (Plan E3)

ENTERPRISEPACKLRG is Office 365 (Plan E3)

ENTERPRISEWITHSCAL is Office 365 (Plan E4)

STANDARDPACK_STUDENT is Office 365 (Plan A1) for Students

STANDARDWOFFPACKPACK_STUDENT is Office 365 (Plan A2) for Students

ENTERPRISEPACK_STUDENT is Office 365 (Plan A3) for Students

ENTERPRISEWITHSCAL_STUDENT is Office 365 (Plan A4) for Students

STANDARDPACK_FACULTY is Office 365 (Plan A1) for Faculty

STANDARDWOFFPACKPACK_FACULTY is Office 365 (Plan A2) for Faculty

ENTERPRISEPACK_FACULTY is Office 365 (Plan A3) for Faculty

ENTERPRISEWITHSCAL_FACULTY is Office 365 (Plan A4) for Faculty

ENTERPRISEPACK_B_PILOT is Office 365 (Enterprise Preview)

STANDARD_B_PILOT is Office 365 (Small Business Preview)

Facebook Comments