2017-07-28 02:58:33 +03:00
---
2016-12-01 20:36:07 +03:00
external help file: Microsoft.Open.AzureAD16.Graph.PowerShell.dll-Help.xml
2020-09-18 18:44:11 +03:00
Module Name: AzureAD
online version:
2016-10-19 02:19:16 +03:00
schema: 2.0.0
---
# Get-AzureADUser
## SYNOPSIS
2016-12-01 20:36:07 +03:00
Gets a user.
2016-10-19 02:19:16 +03:00
## SYNTAX
2016-12-01 20:36:07 +03:00
### GetQuery (Default)
2016-10-19 02:19:16 +03:00
```
2017-02-04 03:05:42 +03:00
Get-AzureADUser [-All < Boolean > ] [-Top < Int32 > ] [-Filter < String > ] [< CommonParameters > ]
2016-10-19 02:19:16 +03:00
```
2016-12-01 20:36:07 +03:00
### GetVague
2016-10-19 02:19:16 +03:00
```
2017-02-04 03:05:42 +03:00
Get-AzureADUser [-SearchString < String > ] [-All < Boolean > ] [< CommonParameters > ]
2016-10-19 02:19:16 +03:00
```
2016-12-01 20:36:07 +03:00
### GetById
2016-10-19 02:19:16 +03:00
```
2017-02-04 03:05:42 +03:00
Get-AzureADUser -ObjectId < String > [-All < Boolean > ] [< CommonParameters > ]
2016-10-19 02:19:16 +03:00
```
## DESCRIPTION
2023-12-13 00:45:31 +03:00
The Get-AzureADUser cmdlet gets a user from the Microsoft Entra ID.
2016-11-19 20:55:01 +03:00
2016-10-19 02:19:16 +03:00
## EXAMPLES
2023-12-06 17:02:21 +03:00
### Example 1: Get top ten users
2016-10-19 02:19:16 +03:00
```
2016-12-01 20:36:07 +03:00
PS C:\>Get-AzureADUser -Top 10
2016-10-19 02:19:16 +03:00
```
2023-12-06 17:02:21 +03:00
This command gets 10 users.
2016-10-19 02:19:16 +03:00
2016-12-01 20:36:07 +03:00
### Example 2: Get a user by ID
2016-10-19 02:19:16 +03:00
```
2016-12-01 20:36:07 +03:00
PS C:\>Get-AzureADUser -ObjectId "testUpn@tenant.com"
2016-10-19 02:19:16 +03:00
```
2016-11-19 20:55:01 +03:00
2016-12-01 20:36:07 +03:00
This command gets the specified user.
2016-10-19 02:19:16 +03:00
2016-12-05 23:34:40 +03:00
### 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
```
2023-12-06 17:02:21 +03:00
This cmdlet gets all users that match the value of SearchString against the first characters in DisplayName or UserPrincipalName.
2016-12-05 23:34:40 +03:00
2017-07-06 14:53:21 +03:00
### Example 4: Get a user by userPrincipalName
```
PS C:\>Get-AzureADUser -Filter "userPrincipalName eq 'jondoe@contoso.com'"
```
This command gets the specified user.
2021-07-28 07:45:56 +03:00
### Example 5: Get a user by JobTitle
2017-07-06 14:53:21 +03:00
```
2021-07-23 09:40:55 +03:00
PS C:\>Get-AzureADUser -Filter "startswith(JobTitle,'Sales')"
2017-07-06 14:53:21 +03:00
```
2023-12-06 17:02:21 +03:00
This command gets all the users whose job title starts with sales, e.g Sales Manager, and Sales Assistant.
2017-07-06 14:53:21 +03:00
2016-12-01 20:36:07 +03:00
## PARAMETERS
2016-10-19 02:19:16 +03:00
2017-02-04 03:05:42 +03:00
### -All
2020-09-18 18:44:11 +03:00
If true, return all users.
If false, return the number of objects specified by the Top parameter
2016-10-19 02:19:16 +03:00
2016-12-01 20:36:07 +03:00
```yaml
2017-02-04 03:05:42 +03:00
Type: Boolean
Parameter Sets: (All)
2020-09-18 18:44:11 +03:00
Aliases:
2016-11-02 02:00:44 +03:00
2016-12-01 20:36:07 +03:00
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False
```
2016-11-21 23:09:47 +03:00
2017-02-04 03:05:42 +03:00
### -Filter
2022-03-22 17:48:25 +03:00
Specifies an OData v3.0 filter statement.
2020-09-18 18:44:11 +03:00
This parameter controls which objects are returned.
2022-03-22 17:48:25 +03:00
Details on querying with OData can be found here.
http://www.odata.org/documentation/odata-version-3-0/odata-version-3-0-core-protocol/#queryingcollections. Not all of the OData v3.0 functions and operators are supported at this time.
2016-11-02 02:00:44 +03:00
2016-12-01 20:36:07 +03:00
```yaml
Type: String
2017-02-04 03:05:42 +03:00
Parameter Sets: GetQuery
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
2016-12-01 20:36:07 +03:00
Required: False
Position: Named
Default value: None
2017-02-04 03:05:42 +03:00
Accept pipeline input: True (ByPropertyName, ByValue)
2016-12-01 20:36:07 +03:00
Accept wildcard characters: False
```
### -ObjectId
2023-12-06 17:02:21 +03:00
Specifies the ID (as a UPN or ObjectId) of a user in Microsoft Entra ID.
2016-10-19 02:19:16 +03:00
```yaml
2016-11-19 20:55:01 +03:00
Type: String
2016-12-01 20:36:07 +03:00
Parameter Sets: GetById
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
2016-12-01 20:36:07 +03:00
Required: True
2016-10-19 02:19:16 +03:00
Position: Named
Default value: None
2016-12-01 20:36:07 +03:00
Accept pipeline input: True (ByPropertyName, ByValue)
2016-10-19 02:19:16 +03:00
Accept wildcard characters: False
```
2016-11-19 20:55:01 +03:00
### -SearchString
2016-12-01 20:36:07 +03:00
Specifies a search string.
2020-09-18 18:44:11 +03:00
2016-10-19 02:19:16 +03:00
```yaml
Type: String
2016-12-01 20:36:07 +03:00
Parameter Sets: GetVague
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
Required: False
Position: Named
Default value: None
2016-12-01 20:36:07 +03:00
Accept pipeline input: True (ByPropertyName, ByValue)
2016-10-19 02:19:16 +03:00
Accept wildcard characters: False
```
2016-12-01 20:36:07 +03:00
### -Top
Specifies the maximum number of records to return.
2016-11-19 20:55:01 +03:00
2016-10-19 02:19:16 +03:00
```yaml
2016-12-01 20:36:07 +03:00
Type: Int32
Parameter Sets: GetQuery
2020-09-18 18:44:11 +03:00
Aliases:
2016-10-19 02:19:16 +03:00
2016-12-01 20:36:07 +03:00
Required: False
2016-10-19 02:19:16 +03:00
Position: Named
Default value: None
2016-12-01 20:36:07 +03:00
Accept pipeline input: True (ByPropertyName, ByValue)
2016-10-19 02:19:16 +03:00
Accept wildcard characters: False
```
2016-12-01 20:36:07 +03:00
### CommonParameters
2020-09-18 18:44:11 +03:00
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters ](http://go.microsoft.com/fwlink/?LinkID=113216 ).
2016-12-01 20:36:07 +03:00
2016-10-19 02:19:16 +03:00
## NOTES
2023-12-06 17:02:21 +03:00
See the [migration guide for Get-AzureADUser ](./migrate/Get-AzureADUser.md ) to the Microsoft Graph PowerShell.
2023-12-10 20:13:51 +03:00
## INPUTS
## OUTPUTS
2016-10-19 02:19:16 +03:00
## RELATED LINKS
2016-11-19 20:55:01 +03:00
2023-12-10 20:13:51 +03:00
[New-AzureADUser ](New-AzureADUser.md )
2020-09-18 18:44:11 +03:00
2023-12-10 20:13:51 +03:00
[Remove-AzureADUser ](Remove-AzureADUser.md )
2016-12-01 20:36:07 +03:00
2023-12-10 20:13:51 +03:00
[Set-AzureADUser ](Set-AzureADUser.md )
2016-12-01 20:36:07 +03:00