Get-EntraUserExtension

Gets a user extension.

Syntax

Get-EntraUserExtension
   -UserId <String>
   [-Property <String[]>]
   [<CommonParameters>]

Description

The Get-EntraUserExtension cmdlet gets a user extension in Microsoft Entra ID.

Examples

Example 1: Retrieve extension attributes for a user

Connect-Entra -Scopes 'User.Read'
$UserId = (Get-EntraUser -ObjectId 'SawyerM@contoso.com').ObjectId
Get-EntraUserExtension -UserId $UserId

onPremisesDistinguishedName :
@odata.context              : https://graph.microsoft.com/v1.0/$metadata#users(identities,onPremisesDistinguishedName,employeeId,createdDateTime)/$entity
createdDateTime             : 18/07/2024 05:13:40
employeeId                  :
identities                  : {@{signInType=userPrincipalName; issuerAssignedId=SawyerM@contoso.com; issuer=SawyerM@contoso.com}}
userIdentities              : {@{signInType=userPrincipalName; issuerAssignedId=SawyerM@contoso.com; issuer=SawyerM@contoso.com}}

This example shows how to retrieve the extension attributes for a specified user. You can use the command Get-EntraUser to get user object Id.

  • -UserId parameter specifies the user object Id.

Parameters

-Property

Specifies properties to be returned.

Type:System.String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-UserId

Specifies the ID of an object.

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