Office 365 Licensing

Is there any way to find how many users are provisioned in office 365 licensing and how many users are pending on Office 365 License.


I found something like this

$collections = @()
Get-MsolUser -All | ? {$_.isLicensed -eq $true} |%{
 foreach($l in $_.Licenses.ServiceStatus)
  $data = New-Object psObject -Property @{
  ObjectID = $_.ObjectID
  UPN = $_.UserPrincipalName
  ServiceName = $l.ServicePlan.ServiceName
  ServiceStatus = $l.ProvisioningStatus
 $collections += $data
$collections | Export-Csv C:TempLicenseInformation.csv -NoTypeInformation

Hi V3manku,

To adequately help, you’ll need to specify more detail.

Are you wanting to find out the number of Office 365 provisioned/pending? All apps (SKUs) or just Office? What type of output are you expecting, a table with total counts? There are multiple types of ProvisioningStatus available, which are you wanting (Success, PendingActivation, PendingProvisioning, Disabled, all of them, etc.)?

Hi Aaron

Thank you for your reply. Here is the situation -

  1. My provisioning script provisioned assigned 600 E3 licenses and i could see E3 license in the negative (any number, let's say 600).
  2. There is no way for me to find out how many licenses are assigned each day so i can see from reporting perspective.
Now i want to find how - i will get reporting of my Office 365 E3 or E1 licenses. Also If if office 365 shows 10 users are pending on liceses, how will i find those pending users.

Thank you in advance, i really appreciate your reply.

If I understand you correctly, the example script below should get the information you’re after:

# Output account SKUs owned by company

AccountSkuId                                ActiveUnits WarningUnits ConsumedUnits
------------                                ----------- ------------ -------------
tenantname:STREAM                           1000000     0            0
tenantname:POWERAPPS_INDIVIDUAL_USER        10000       0            18
tenantname:STANDARDWOFFPACK_IW_FACULTY      500000      0            50
tenantname:WINDOWS_STORE                    25          0            0
tenantname:STANDARDWOFFPACK_STUDENT         201         0            0
tenantname:STANDARDWOFFPACK_IW_STUDENT      1000000     0            224
tenantname:FLOW_FREE                        10000       0            11
tenantname:POWERAPPS_VIRAL                  10000       0            12
tenantname:M365EDU_A3_FACULTY               1           0            1
tenantname:STANDARDWOFFPACK_FACULTY         50          0            0

To check user accounts that have “STANDARDWOFFPACK_IW_FACULTY” (Office Pro Plus A1 for faculty) assigned, simply run this code:

$assignedProPlusA1Licenses = Get-MsolUser | Where-Object -FilterScript { $_.Licenses.AccountSku.SkuPartNumber -match 'STANDARDWOFFPACK_IW_FACULTY' }

# Output the UPNs with the assigned license

# Confirm the count of licenses matches the ConsumedUnits

You can also loop through all the SKUs in the Get-MsolAccountSku output and group them by license (E1 or E3).

Edit: no changes, just corrected formatting.

Thanks Aaron, somehow i am not able to attach a picture. You must have seen in licensing view , its says let’s say 600 users need valid licenses. I want to find those users pending on Licenses.


$cred = get-credential

Connect-MsolService -Credential $cred

$Users = Get-Msoluser -all

$results = ForEach ($user in $users) {
ForEach ($license in $user.licenses.servicestatus) {
$props = @{‘UPN’=$user.userprincipalname
‘Name’ = $license.ServicePlan.ServiceName
‘Status’ = $license.ProvisioningStatus}

New-Object -Type PSObject -Prop $props

$results | where {$_.status -like “pending”}


You can do whatever you want with the results variable, the where filter I used was just an example

Thank you so much Aaron for solution. Awesome , apologies for delayed response.