Export Office 365 Users to CSV using PowerShell
We can easily export users using Office 365 Admin center UI, but in this way we can get only set of attributes and we can’t easily filter our required set of users. In this article, I am going to write powershell script to export all office 365 users and export only licensed users to csv file.
Note: Before proceed, Install and Configure Azure AD PowerShell
Use the below command to export all the office 365 users. You can add more columns to export.
In some scenarios, you might want to get details of only licensed office 365 users. To get only licensed users, you need to apply where filter in the output of Get-MsolUser cmdlet.
You can also extract what are the licenses has been assigned to every users. The below command export all the licensed users and applied license details to csv file.