Get-AzureRmADUser

Filters active directory users.

Important

Because Az PowerShell modules now have all the capabilities of AzureRM PowerShell modules and more, we'll retire AzureRM PowerShell modules on 29 February 2024.

To avoid service interruptions, update your scripts that use AzureRM PowerShell modules to use Az PowerShell modules by 29 February 2024. To automatically update your scripts, follow the quickstart guide.

Syntax

Get-AzureRmADUser
   [-UserPrincipalName <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-IncludeTotalCount]
   [-Skip <UInt64>]
   [-First <UInt64>]
   [<CommonParameters>]
Get-AzureRmADUser
   -StartsWith <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-IncludeTotalCount]
   [-Skip <UInt64>]
   [-First <UInt64>]
   [<CommonParameters>]
Get-AzureRmADUser
   -DisplayName <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-IncludeTotalCount]
   [-Skip <UInt64>]
   [-First <UInt64>]
   [<CommonParameters>]
Get-AzureRmADUser
   -ObjectId <Guid>
   [-DefaultProfile <IAzureContextContainer>]
   [-IncludeTotalCount]
   [-Skip <UInt64>]
   [-First <UInt64>]
   [<CommonParameters>]
Get-AzureRmADUser
   -UserPrincipalName <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-IncludeTotalCount]
   [-Skip <UInt64>]
   [-First <UInt64>]
   [<CommonParameters>]
Get-AzureRmADUser
   -Mail <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-IncludeTotalCount]
   [-Skip <UInt64>]
   [-First <UInt64>]
   [<CommonParameters>]

Description

Filters active directory users.

Examples

Example 1 - List all users

PS C:\> Get-AzureRmADUser

Lists all AD users in a tenant.

Example 2 - List all users using paging

PS C:\> Get-AzureRmADUser -First 100

Lists the first 100 AD users in a tenant.

Example 3 - Get AD user by user principal name

PS C:\> Get-AzureRmADUser -UserPrincipalName foo@domain.com

Gets the AD user with user principal name "foo@domain.com".

Example 4 - List by search string

PS C:\> Get-AzureRmADUser -SearchString Joe

Lists all AD users whose display name starts with "Joe".

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DisplayName

The display name of the user.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-First

The maximum number of objects to return.

Type:UInt64
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IncludeTotalCount

Reports the number of objects in the data set. Currently, this parameter does nothing.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Mail

The user mail.

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-ObjectId

Object id of the user.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-Skip

Ignores the first N objects and then gets the remaining objects.

Type:UInt64
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-StartsWith

Used to find users that begin with the provided string.

Type:String
Aliases:SearchString
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-UserPrincipalName

UPN of the user.

Type:String
Aliases:UPN
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False

Inputs

String

Guid

Outputs

PSADUser