| title | Get-EntraUser |
|---|---|
| description | This article provides details on the Get-EntraUser command |
| ms.topic | reference |
| ms.date | 07/12/2024 |
| ms.author | eunicewaweru |
| manager | mwongerapk |
| author | msewaweru |
| external help file | Microsoft.Entra-Help.xml |
| Module Name | Microsoft.Entra |
| online version | https://learn.microsoft.com/powershell/module/Microsoft.Entra/Get-EntraUser |
| schema | 2.0.0 |
Reference
Module: Microsoft.Entra
Gets users from Microsoft Entra ID.
Get-EntraUser
[-ReturnDeletedUsers]
[-City <String>]
[-Country <String>]
[-Department <String>]
[-DomainName <String>]
[-EnabledFilter <UserEnabledFilter>]
[-State <String>]
[-Synchronized]
[-Title <String>]
[-HasErrorsOnly]
[-LicenseReconciliationNeededOnly]
[-UnlicensedUsersOnly]
[-UsageLocation <String>]
[-SearchString <String>]
[-MaxResults <Int32>]
[-TenantId <Guid>]
[<CommonParameters>]Get-EntraUser
-UserId <Guid>
[-ReturnDeletedUsers]
[-TenantId <Guid>]
[<CommonParameters>]The Get-EntraUser cmdlet gets an individual user or list of users. Specify the ObjectId parameter to get a specific user.
This example demonstrates how to retrieve all users from Microsoft Entra ID.
Connect-Entra -Scopes 'User.Read.All'
Get-EntraUser DisplayName Id Mail UserPrincipalName
----------- -- ---- -----------------
Rastislav Moravcik aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb RastislavM@contoso.com RastislavM@contoso.com
Yerzhan Kasymuly bbbbbbbb-1111-2222-3333-cccccccccccc YerzhanK@contoso.com YerzhanK@contoso.com
Baglan Serik cccccccc-2222-3333-4444-dddddddddddd BaglanS@contoso.com BaglanS@contoso.com
Abdulla Kafeel dddddddd-3333-4444-5555-eeeeeeeeeeee AbdullaK@contoso.com AbdullaK@contoso.com
Vladimir Zeman eeeeeeee-4444-5555-6666-ffffffffffff VladimirZ@contoso.com VladimirZ@contoso.com
This command retrieves all users in the company, displaying up to the default limit of 500 results.
In this example, we provide the user's ID to retrieve their details.
Connect-Entra -Scopes 'User.Read.All'
Get-EntraUser -ObjectId 'RastislavM@contoso.com'DisplayName Id Mail UserPrincipalName
----------- -- ---- -----------------
Rastislav Moravcik aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb RastislavM@contoso.com RastislavM@contoso.com
This example returns the details of the specified user using their User Principal Name (UPN) RastislavM@contoso.com.
-ObjectIdparameter specifies the ID of the user to retrieve.
Indicates that this cmdlet returns all results. Don't specify together with the MaxResults parameter.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: All__0
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseSpecifies the unique object ID of the user to get.
Type: System.String
Parameter Sets: GetUser__0
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False