Get-EntraUserExtension

获取用户的扩展。

语法

Default (默认值)

Get-EntraUserExtension

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

说明

该 Get-EntraUserExtension cmdlet 检索Microsoft Entra ID用户扩展。

示例

示例 1:检索用户的扩展属性

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}}

此示例演示如何检索指定用户的扩展属性。

  • -UserId 参数指定用户对象 ID。

示例 2:检索从本地同步的用户的扩展属性

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}}

此示例演示如何检索从本地同步其扩展的指定用户的扩展属性。

  • -UserId 参数指定用户对象 ID。

参数

-IsSyncedFromOnPremises

筛选仅显示从本地同步的用户扩展。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False
别名:Select

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Property

指定要返回的属性。

参数属性

类型:

System.String[]

默认值:None
支持通配符:False
不显示:False
别名:Select

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-UserId

指定对象的 ID。

参数属性

类型:System.String
默认值:None
支持通配符:False
不显示:False
别名:对象标识符 (ObjectId), UPN, Identity, UserPrincipalName

参数集

(All)
Position:Named
必需:True
来自管道的值:True
来自管道的值(按属性名称):True
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters。