Offer Offer

News We Recently Launched AD Migrator and AD Reporter.

Export Licensed Users of Office 365 to CSV Format – Quick Overview

  author
Written By Mohit Jha
Anuraag Singh
Approved By Anuraag Singh
Published On March 11th, 2024
Reading Time 6 Minutes Reading

Organizations deploy Microsoft O365, to ensure the continuous availability of resources to their workers and enhance their productivity. Microsoft provides the Office 365 Onboarding benefit for entitled services in eligible plans. The Office 365 licenses from the licensing plans (also known as O365 plans or SKUs) allow access to services that are defined for those plans. But, a user may not have access to all the services, which are available in a license that is currently allotted to them.

Export Users List from Office 365

The Office 365 licenses and Office 365 user accounts do not need to have one-to-one correspondence. It is possible to have users who do not have the Office 365 license, and it is also possible to have the Office 365 licenses, which have not been assigned to a user. (As a matter of fact, a single user account also can even have various Office 365 licenses.)

Table of Content

Thus, there are many times when administrators may want a CSV of O365 users with a specific license plan for deciding license usage or some other necessity. To generate this and check out the status of services on User accounts, we need to connect our PowerShell with an Office 365 account.

User’s Concern

Many Office 365 users ask for a solution to export users list from Office 365 with licenses. They post their problems on different technical forums, social networking sites, and blogs. We have selected some queries from these websites to state them here. This will assist users in understanding the demand to export a list of Office 365 licensed users to CSV.

I am trying to extract a list of all the O365 users from a tenant and the respective licenses, which are assigned to them. The output needs to be in the CSV file format so that I can export the user, company field, and license type and view the list easily. Also, want to know about Microsoft Office 365 backup and recovery policy to secure mailbox.

I am searching for a technique to export a list of users from the O365 tenant. The list must include the display name, assigned license, email address, and group membership (security group). I think there is no method to do this via the Get-Msoluser command as there is no result on groups. Acquiring information on the group membership is a separate command. Is there a technique to give me the result as a CSV file with the email address, display name, licenses, and group?

How can I reference a CSV file incorporating UserPrincipalName’s and run the Get-Msoluser for exporting a list of the specific users’ licenses? The output file must have UserPrincipalName and ENTERPRISEPACK or STANDARDPACK license assigned. Thanks.

Export Licensed Users of Office 365 to CSV Format via PowerShell

Office 365 does not provides a functionality to export licensed users to csv file format. To create this, we are required to use the PowerShell commands. Below is a script that reports on all the licensed Office 365 users in all the customer tenants and exports their information and the license details to a CSV file.
[Try SysTools Office 365 Mailbox Backup and Restore to backup and restore O365 emails and Onedrive documents.]

Prerequisites to run PowerShell command for Office 365

If you have never connected to O365 using PowerShell before then, you might need to prepare your system first to connect with Office 365. For this, you need to install the following components:

  • Microsoft Online Services Sign-In Assistant for IT Professionals RTW,
  • Windows Azure Active Directory Module for Windows PowerShell

After installing these prerequisites, you can connect easily to Office 365 via PowerShell.

Below Office 365 Powershell List Users With Specific License in CSV

  • Click on the Start menu and hit right-click on Windows Azure Active Directory Module for Windows PowerShell and select the Run as Administrator option.

Export Users List from Office 365

  • Administrator: Windows Azure Directory window will open now.

Export Users List from Office 365 PowerShell

Next, we need to connect our Office 365 Account with PowerShell

  • To connect your Office 365 with PowerShell, execute the following line of code:

  • This will prompt a Windows PowerShell Credential Request wizard that asks for the username and password.

Here, enter the Global Administrator username and password for connecting to Office 365 account

  • After successfully logging in, we will see another wizard that includes a warning message. Well, we can ignore the warning message in yellow

  • Next, to see all the available users (licensed and unlicensed), use the following code snippet:

  • This command can be used to look at all the user accounts where the isLicensed property is equivalent to True, which means Licensed Office 365 User returns the information similar to this:

If the isLicensed is equal to False, it means that the user does not have a license for Office 365

Export Users list from Office 365 to CSV file – Licensed User

  • If you only want the list of licensed users then, execute the below-mentioned code snippet:

Export Users list from Office 365 to CSV file – Unlicensed User

  • In case you need to export all the unlicensed users then, use the following code:

  • Now, to export these users into .csv file format:
    For exporting all the licensed users with their user name, license type, account login name, etc., run the following code snippet:

  • The exported or resultant CSV file will look like the following:

Concluding Lines

‘How to export users list from Office 365 with licenses to CSV is such as common user query. It is quite easy to export the list of all your Office 365 users into a CSV file, as you will need to open up the PowerShell to do it. Here, we have discussed the complete steps to quickly find the licensed as well as unlicensed users in the organization. This cmdlet will certainly export a list of all your licensed and unlicensed O365 users into a CSV format that you can simply open in Excel.

Frequently Asked Queries

Can I export the unlicensed user list from Office 365?

Yes, you can export the list of unlicensed Office 365 users. Similar to the licensed users’ power shell provide the command “ Get-MsolUser – All -UnlicensedUsersonly ” to obtain the list of Office 365 unlicensed.

Is there any pre-requirement is needs to start with PowerShell?

Yes, before you start working with PowerShell you must need to install 2 components that are Microsoft Online Services Sign-In Assistant for IT Professionals RTW & Windows Azure Active Directory Module for Windows Power Shell.

How can I check the users who are licensed & Unlicensed?

You can use the Power shell command “ Get-MsolUser ”. Which will list the entire user with an is licensed attribute that indicates whether the user is assigned a Microsoft license or not.

Is a user allowed to be assigned with only one Microsoft license?

No, a single user can be assigned with multiple licenses. It will depend on the services that a user needs to access while working with the account.

  author

By Mohit Jha

Mohit is a writer, researcher, and editor. Cyber ​​security and digital forensics are the two subjects that keep Mohit out of his seat. In addition, he hopes that the well-researched and thought-out articles he finds will help people learn.

Office 365 Backup Services