Edit

Share via


Get-EntraUserExtension

Gets a user's extension.

Syntax

Default (Default)

Get-EntraUserExtension

    -UserId <String>
    [-Property <String[]>]
    [-IsSyncedFromOnPremises <String>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Get-EntraUserExtension cmdlet retrieves extensions for a user in Microsoft Entra ID.

Examples

Example 1: Retrieve extension attributes for a user

Connect-Entra -Scopes 'User.Read.All'
Get-EntraUserExtension -UserId 'SawyerM@contoso.com'
id                          : aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb
userPrincipalName           : sawyerm@contoso.com
employeeId                  :
identities                  : {@{signInType=userPrincipalName; issuer=contoso.com; issuerAssignedId=sawyerm@contoso.com}}
onPremisesDistinguishedName :
createdDateTime             : 3/7/2024 12:34:59 AM
userIdentities              : {@{signInType=userPrincipalName; issuer=contoso.com; issuerAssignedId=sawyerm@contoso.com}}

This example shows how to retrieve the extension attributes for a specified user.

  • -UserId parameter specifies the user object ID.

Example 2: Retrieve extension attributes for a user synced from on-premises

Connect-Entra -Scopes 'User.Read.All'
Get-EntraUserExtension -UserId 'SawyerM@contoso.com' -IsSyncedFromOnPremises $true
id                          : aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb
userPrincipalName           : sawyerm@contoso.com
employeeId                  :
identities                  : {@{signInType=userPrincipalName; issuer=contoso.com; issuerAssignedId=sawyerm@contoso.com}}
onPremisesDistinguishedName :
createdDateTime             : 3/7/2024 12:34:59 AM
userIdentities              : {@{signInType=userPrincipalName; issuer=contoso.com; issuerAssignedId=sawyerm@contoso.com}}

This example shows how to retrieve the extension attributes for a specified user whose extensions are synced from on-premises.

  • -UserId parameter specifies the user object ID.

Parameters

-IsSyncedFromOnPremises

Filter to only show user's extensions synced from on-premises.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Select

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Property

Specifies properties to be returned.

Parameter properties

Type:

System.String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Select

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-UserId

Specifies the ID of an object.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ObjectId, UPN, Identity, UserPrincipalName

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.