🎉 Our Microsoft 365 Reporting & Management Tool is available in Marketplace 🚀
Microsoft Entra ID

How to Export Microsoft 365 User License Report

Are you concerned about Microsoft 365 license management, especially in the case of former employees who may still have active licenses? This situation can potentially lead to increased Microsoft 365 licensing costs and data security risks. So, take control today! Learn how to export user license report in Microsoft 365 and effectively handle unused licenses.

Microsoft 365 tools

Using Microsoft 365 Admin Center

Microsoft 365 Permission Required
Global Admin or User Admin or License Admin.
  • Login to the Microsoft 365 admin center.
  • Navigate to Users» Active Users. From the filter icon at the top, select Licensed users.
Using Microsoft 365 Admin Center
  • You can get a list of all licensed users in Office 365 along with their licenses as shown above.

Using Windows PowerShell

Microsoft 365 Permission Required
Global Admin or User Admin or License Admin.
  • Connect to Microsoft Graph PowerShell using the below cmdlet.
  • Windows PowerShell Windows PowerShell
     Connect-Graph -Scopes User.Read.All, Organization.Read.All
  • Run the following cmdlet in PowerShell to get Microsoft 365 licenses assigned to users.
  • Windows PowerShell Windows PowerShell
     Get-MgUser -Filter 'assignedLicenses/$count ne 0' -ConsistencyLevel eventual -CountVariable licensedUserCount -All -Select DisplayName,AssignedLicenses | Format-Table -Property UserPrincipalName,DisplayName,AssignedLicenses
Using Windows PowerShell
  • The above cmdlet displays all licensed users’ display name and licenses assigned to them.

Using PowerShell Script

Microsoft 365 Permission Required
Global Admin or User Admin or License Admin.
  • However, it can be challenging to pinpoint the exact subscription names using the PowerShell cmdlet mentioned above. As a solution, we've developed a PowerShell script that displays the friendly names of Microsoft 365 licenses assigned to users.
  • Download and run the following script in the Administrator PowerShell.
Using PowerShell Script
O365UserLicenseReport.ps1

Your toolkit for license optimization in Microsoft 365!

The AdminDroid Microsoft 365 license management tool provides complete information about the licenses within your organization. Moreover, it allows you to audit subscriptions that are approaching their expiration, expired Microsoft 365 subscriptions and licenses assigned to sign-in disabled users.

Customize the Alerts on Users’ License Changes

Receive the alert report in your mailbox, categorized as Severe, High, Medium, Low, and Info so that you can make precise decisions based on these levels.

Microsoft 365 Suspended Subscriptions

Reactivate the suspended Microsoft 365 subscriptions of users within 90 days to avoid data loss.

Hierarchical View of Users’ Inactive Days

Using various reporting capabilities, get the M365 users who have not signed in for a long period of time. This simplifies the process of revoking licenses for those who're inactive for an extended period.

Check Microsoft 365 Unlicensed Users

Assign licenses to Microsoft 365 unlicensed users who may need access to specific services for efficient task performance.

Regain Licenses of Disabled Users

Find disabled users still licensed in Microsoft 365 and allocate them to active users to avoid unwanted license usage.

Renew Expired Microsoft 365 Subscriptions

Track the subscription expired users, and make purchasing choices as needed.

AdminDroid simplifies Microsoft 365 license assignment by offering enormous reports and features. With the diverse range of Microsoft 365 licenses available, it is crucial to procure and assign precise licenses to users, thus optimizing license usage.

Important Tips

Audit the unused Microsoft 365 subscriptions and then consider purchasing necessary units in the future to reduce licensing costs.

Remove Microsoft 365 licenses from shared mailboxes, as they don't require licensing until they reach 50 GB of storage.

Track Microsoft 365 license assignment events in your organization and ensure users have access to appropriate services for efficient task performance.

Common Errors and Resolution Steps

The following are the possible errors and troubleshooting hints while dealing with licensed users in Office 365.

Error Get-MgUser: Calling principal does not have required MSGraph permissions AuditLog.Read.All

This error occurs when the MS Graph module does not have permission to read the audit log to display the last active time of users.

Fix Connect to the MS Graph PowerShell using the below cmdlet to give permission to read the audit log.
Connect-MgGraph –Scopes Directory.Read.All,AuditLog.Read.All

Error Set-MgUserLicense: User license is inherited from a group membership and it cannot be removed directly from the user.

This happens when you try to remove a license from a Microsoft 365 user that was inherited from a group.

Fix Run the below PowerShell cmdlets to remove the user from the security group from which the license was inherited.
// Connect to the MS Graph PowerShell to give permission to edit group membership details.
Connect-MgGraph -Scopes GroupMember.ReadWrite.All, Group.ReadWrite.All, Directory.ReadWrite.All
// Run the below cmdlet to remove a user from the group.
Remove-MgGroupMemberByRef -DirectoryObjectId "<User's Object Id>" -GroupId "<Group's Object Id>"

Error Conflicting service plans.

This error occurs when you allocate a license to a group, and the service plans within that license can’t overlap with the plans already assigned to a user through a different license directly.

Fix Disable any one of the plans from the license assigned to the user.

Error License assignments failed.

This error occurs when you assign a license for users from the Azure portal whose usage location is not defined.

Fix Set the usage location by selecting the desired user from the All Users section in the Microsoft Entra admin center (formerly Azure Active Directory).

Error Your message to couldn’t be delivered.

This error occurs when you send an email to a user without an Exchange Online license in your organization.

Fix Assign an Exchange Online license for the user by navigating to the Users tab from Microsoft 365 admin center.

Kickstart Your Journey With
AdminDroid

Your Microsoft 365 Companion with Enormous Reporting Capabilities

Download Now
User Help Manuals Compliance Docs Customer Stories