How to get Azure AD users using PowerShell scripts
This article illustrates how you can get the Azure AD users in your network using PowerShell scripts and ADManager Plus, an Active Directory management and reporting tool and why ADManager Plus is the best option out of the two.
Azure PowerShell
Steps to fetch Azure AD users using PowerShell scripts:
- Obtain the display name of the user that you would like to fetch.
- Execute the following PowerShell script and list the members of the desired groups:
Copied
Get-AzADUser -DisplayName $name
Click to copy entire script
ADManager Plus
Steps to list Azure AD users using ADManager Plus:
- Log in to ADManager Plus and navigate to Microsoft 365 tab > Reports > User Reports.
- Under General User Reports, click Microsoft 365 Users.
- Select the desired Microsoft 365 tenant from the Microsoft Tenant drop-down list and select the domains/groups from the Filter By drop-down list.
- Click Generate Now.
Limitations of using PowerShell scripts to list Azure AD users:
- PowerShell scripts when generated in bulk can take a lot of time to generate and can affect system performance.
- The scripts are generated in a command line and are not user-friendly.
- PowerShell scripts are text-based commands that follow a certain syntax and is quite error-prone.
Benefits of using ADManager Plus:
- Predefined reports that can be generated with a click of a button.
- Manage users on the fly from reports.
- Reports can be exported in CSV, XLS, PDF, and HTML formats.