Get-AzureRmADUser

Filters active directory users.

Caution

The AzureRM PowerShell module will retire on 29 February 2024. For more information, see Migrate Azure PowerShell from AzureRM to Az.

Retirement indicates that the AzureRM PowerShell module will be deprecated, subsequently ceasing to receive support. While this does not inherently mean the module will stop functioning, its use beyond 29 February 2024 will be at the user's discretion and risk, as it will no longer be maintained or updated.

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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DisplayName

The display name of the user.

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

-First

The maximum number of objects to return.

Type:UInt64
Position:Named
Default value:None
Required:False
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
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Mail

The user mail.

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

-ObjectId

Object id of the user.

Type:Guid
Position:Named
Default value:None
Required:True
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
Required:False
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
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-UserPrincipalName

UPN of the user.

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

Inputs

String

Guid

Outputs

PSADUser