When operating at the Enterprise level, it is easy to lose track of how many email accounts your company has and how many of those are being used. This becomes problematic when purchasing licensing, because there’s no point buying licenses for idle users.  

One of Zag’s clients realized this when conducting their Microsoft Enterprise Agreement True Up; they needed accurate reporting in order to ensure that they are not purchasing more licenses than necessary under their Enterprise Agreement.

Our client asked us for a list of all Office 365 mailboxes, the license applied, and the last login. This is not something that Office 365 keeps track of or reports on, so we couldn’t simply pull the information from the source.  

A ZAG Solution Architect came up with the idea to write a PowerShell script using multiple Office 365 administrative interfaces to capture and correlate the information our client needed.  While this may be a common scenario, it is not one that is easily resolved. Extensive knowledge of PowerShell scripting and the available Office 365 administrative interfaces was required.

Exchange Online Remote PowerShell was used to get a list of all the mailboxes and the last login date and time.  Azure Active Directory PowerShell was used to get a list of licenses applied to each mailbox captured from the Exchange Online Remote PowerShell.  Finally, all the necessary information was exported to a text file, so it could be manipulated in Excel.

This solution allowed our client to determine the number of licenses they needed and insured that they were not paying for licenses they didn’t need.

Learn more information about this PowerShell script and how you can utilize it for your business needs.