In this Azure PowerShell article, we will discuss the syntax and usage of the Get-AzADUser PowerShell command with examples.
Get-AzADUser
The Get-AzADUser Azure PowerShell command can get you the list of AD users.
Syntax
Below is the syntax of the Get-AzADUser PowerShell command.
Get-AzADUser
Get-AzADUser -Mail <String>
Get-AzADUser -DisplayName <String>
Get-AzADUser -StartsWith <String>
Get-AzADUser -ObjectId <String>
Get-AzADUser -SignedIn
Let’s discuss a few examples of how to use the Get-AzADUser PowerShell command.
Example-1:
Run the below PowerShell command to get the list of the AD users.
Get-AzADUser
After executing the above command, I got the below output.
DisplayName Id Mail UserPrincipalName
----------- -- ---- -----------------
Bijay Kumar Sahoo 54481342-e592-47c2-ba89-b07dcadf9346 fewlines4biju_hotmail.c...
You can check out the same output below

Example-2:
You can execute the below PowerShell command to get the Azure AD user based on the Display name. Here, I will get the user details with the display name “Bijay Kumar Sahoo”.
Get-AzADUser -DisplayName "Bijay Kumar Sahoo"
After executing the above command, I got the below output.
DisplayName Id Mail UserPrincipalName
----------- -- ---- -----------------
Bijay Kumar Sahoo 54481342-e592-47c2-ba89-b07dcadf9346 fewlines4biju_hotmail.c...
You can check out the same output below

Example-3:
To get the AD user based on the specified Object ID, you can execute the below PowerShell command.
PS C:\WINDOWS\system32> Get-AzADUser -ObjectId 54481342-e592-47c2-ba89-b07dcadf9346
DisplayName Id Mail UserPrincipalName
----------- -- ---- -----------------
Bijay Kumar Sahoo 54481342-e592-47c2-ba89-b07dcadf9346 fewlines4biju_hotmail.c...
You can check out the same output below

Example-4:
You can execute the below PowerShell command to get the signed-in user details.
Get-AzADUser -SignedIn
After executing the above command, I got the below output.
PS C:\WINDOWS\system32> Get-AzADUser -SignedIn
DisplayName Id Mail UserPrincipalName
----------- -- ---- -----------------
Bijay Kumar Sahoo 54481342-e592-47c2-ba89-b07dcadf9346 fewlines4biju_hotmail.c...
You can see the same output below

You may also like following the below articles
Wrapping Up
In this Azure article, we discussed the syntax and usage of the Get-AzADUser PowerShell command with a few examples. Thanks for reading this article !!!