Get-​Azure​AD​User

Gets a user.

Syntax

Get-AzureADUser
   [-All <Boolean>]
   [-Filter <String>]
   [-Top <Int32>]
   [<CommonParameters>]
Get-AzureADUser
   [-All <Boolean>]
   -ObjectId <String>
   [<CommonParameters>]
Get-AzureADUser
   [-All <Boolean>]
   [-SearchString <String>]
   [<CommonParameters>]

Description

The Get-AzureADUser cmdlet gets a user from Azure Active Directory (AD).

Examples

Example 1: Get ten users

PS C:\>Get-AzureADUser -Top 10

This command gets ten users.

Example 2: Get a user by ID

PS C:\>Get-AzureADUser -ObjectId "testUpn@tenant.com"

This command gets the specified user.

Example 3: Search among retrieved users

PS C:\> Get-AzureADUser -SearchString "New"

ObjectId                             DisplayName UserPrincipalName                   UserType
--------                             ----------- -----------------                   --------
5e8b0f4d-2cd4-4e17-9467-b0f6a5c0c4d0 New user    NewUser@contoso.onmicrosoft.com     Member
2b450b8e-1db6-42cb-a545-1b05eb8a358b New user    NewTestUser@contoso.onmicrosoft.com Member

This cmdlet gets all users that match the value of SearchString against the first characters in DisplayName or UserPrincipalName .

Required Parameters

-ObjectId

Specifies the ID (as a UPN or ObjectId) of a user in Azure AD.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False

Optional Parameters

-All

If true, return all users. If false, return the number of objects specified by the Top parameter

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-Filter

Specifies an oData v3.0 filter statement. This parameter controls which objects are returned.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-SearchString

Specifies a search string.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False
-Top

Specifies the maximum number of records to return.

Type:Int32
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName, ByValue)
Accept wildcard characters:False