Getting a list of all users with user properties
The Get-MsolUser
cmdlet in the MsOnline
PowerShell module is a very flexible and useful tool for any admin's toolkit. The cmdlet gives an admin instant access to all user properties within a tenant, but can also be restricted to specific users or even users of a certain type.
Generating reports of users and groups of users is a common task for any tenant admin. This recipe focuses on how to pull that data with only a few lines of code.
Let's practice generating a list of all users with properties.
Getting ready
Using the skills learned in the Setting up the PowerShell environment recipe from Chapter 1, Office 365 Setup and Basic Administration, connect to your Office 365 tenant via PowerShell.
How to do it…
- Enter the following command into your PowerShell or ISE window to return a list of all Office 365 users:
Get-MsolUser
This will give the following output: