Subscription count by country in PowerShell

Posted on 2012-09-03
Last Modified: 2012-09-07

This is my first question at Experts Exchange. Please let me know if I am missing something vital in my question. Thank you!

Our company uses Office 365 for our callaborations needs (E-mail, Lync and SharePoint).
The parent company has 8 child-companies which we need to bill each month for the Office 365 licenses being used in each child-company. One legal company per country.

How may I, using PowerShell or another tool, get the amount of different licences being used in Office 365 grouped by country?
Counting manually each month is not an option as it is too many accounts.

Example output
Country       {company:CRMSTANDARD}   {company:ENTERPRISEPACK}
Sweden       2                                                      78
Norway       1                                                      4
Germany     4                                                     120
France         3                                                      55

Thank you for your help!
Question by:jeliasson
    LVL 3

    Expert Comment

    LVL 1

    Author Comment

    Sorry, but that's abit to lightweight to the result/output I'm trying to achieve.
    LVL 37

    Accepted Solution

    You can extract the data using PowerShell, but managing it there is a bit complicated.

    Here is my suggestion:

    Download the Office 365 Helper Scripts from:

    Run the GetMsolUserReport.ps1 to get the needed data

    Open the generated csv file in Excel and make a Pivot Table to group the data as per your preference. For example, UPN for the Report filter, AssignedLicenses for Column Labels, UsageLocation for Row Labels and Count of Assigned licenses for Values

    You might consider filtering the unlicensed users first, as the script will return all users in your tenant
    LVL 1

    Author Closing Comment

    Thank you for your help!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do email signature updates give you a headache?

    Do you feel like you are constantly making changes to email signatures? Are the images not formatting how you want them to? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today.

    Find out how to use dynamic social media in email signatures with this top 10 DOs & DON’Ts.
    I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
    In a previous video Micro Tutorial here at Experts Exchange (, I explained how to get a free, one-month trial of Office …
    This Experts Exchange lesson shows how to use VBA to loop through rows in Excel.  In order to sort, filter, and use database features, there needs to be a value in each column for every row. When data arrives with values missing, code to copy values…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now