Export Active Users (Licensed Users) In .CSV Format From Office 365 Using PowerShell

Overview

Sometimes, there is a situation in which we need to connect our PowerShell with Office 365. We received one such requirement from one of our clients. They wanted a CSV for all licensed users available in Office 365. Office 365 does not provide a feature to export all licensed users in .csv format. To generate that, we need to write PowerShell commands.


Prerequisites to run PowerShell command for Office 365

  • Microsoft Online Services Sign-In Assistant – Download Link

  • Windows Azure Active Directory Module for Windows PowerShell – Download Link

Installing the above two prerequisites are very easy.


Step 1

After installing the above two prerequisites, we can view “Windows Azure Active Directory Module for Windows PowerShell” in our search window.


The below screenshot shows Windows Azure Active Directory Module for Windows PowerShell.