Export Office 365 Licenses

An Office 365 admin perform one repetitive task on the Azure AD PowerShell is to generate license report from Office 365. Two simple Cmdlets Get-MsolUser  and Get-MsolAccountSku can be used to generate many reports. This article uses variation of these Cmdlets to extract license report.

Connect to Exchange Online Services

Import-Module MSOnline

Find out what licenses are available for you to consume from Office 365 tenant.

Get-MsolAccountSku | Format-Table AccountSkuId, SkuPartNumber

Generate a license report for all users with Office 365 licenses

Get-MSOLUser –MaxResults 100000 | select-object Displayname,userprincipalname,islicensed,{$_.Licenses.AccountSkuId}| Export-CSV c:\temp\userlist.csv –NoTypeInformation

Once CSV is generated, just filter the report to suit your need.

Find Consumed Licenses for specific license type

Get-MsolAccountSku | Where-Object {$_.SkuPartNumber -eq “ENTERPRISEPACK”}

Find all consumed licenses


Find all licenses users in a specific domain

Get-MsolUser -MaxResults 100000 –DomainName domain.com.au | Select-Object Displayname,UserPrinciPalname,IsLicensed

Find out all users who consumed any licenses

Get-MsolUser -all | where {$_.isLicensed -eq “True”} | Select-Object DisplayName,UserPrincipalname,IsLicensed

Find out all users in a specific location who consumed any licenses

Get-MsolUser -all | where {$_.UsageLocation -eq “Australia”} | Select-Object DisplayName,UserPrincipalname,IsLicensed,UsageLocation

About Raihan Al-Beruni

My Name is Raihan Al-Beruni. I am working as an Infrastructure Architect in Data Center Technologies in Perth, Western Australia. I have been working on Microsoft technologies for more than 15 years. Other than Microsoft technologies I also work on Citrix validated solution and VMware data center virtualization technologies. I have a Masters degree in E-Commerce. I am certified in Microsoft, VMware, ITIL and EMC. My core focus is on cloud technologies. In my blog I share my knowledge and experience to enrich information technology community as a whole. I hope my contribution through this blog will help someone who wants more information on data center technologies.
Gallery | This entry was posted in Office 365 and tagged , , , , . Bookmark the permalink.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s