Get-EntraUserDirectReport
获取用户的直接报告。
语法
Default (默认值)
Get-EntraUserDirectReport
-UserId <String>
[-All]
[-Top <Int32>]
[-Property <String[]>]
[<CommonParameters>]
说明
该 Get-EntraUserDirectReport cmdlet 获取Microsoft Entra ID中用户的直接报告。 指定 UserId 参数获取用户的直接报告。
示例
示例 1:获取用户的直接报表
Connect-Entra -Scopes 'User.Read', 'User.Read.All'
Get-EntraUserDirectReport -UserId 'SawyerM@contoso.com' |
Select-Object Id, displayName, userPrincipalName, createdDateTime, accountEnabled, userType |
Format-Table -AutoSize
id displayName userPrincipalName createdDateTime accountEnabled userType
-- ----------- ----------------- --------------- -------------- --------
bbbbbbbb-1111-2222-3333-cccccccccccc Christie Cline ChristieC@Contoso.com 10/7/2024 12:32:25 AM True Member
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Isaiah Langer IsaiahL@Contoso.com 10/7/2024 12:33:16 AM True Member
此示例演示如何在 Microsoft Entra ID 中检索用户的直接报表。
-
-UserId参数指定用户的 ID(UserPrincipalName 或 UserId)。
示例 2:获取所有直接报表
Connect-Entra -Scopes 'User.Read', 'User.Read.All'
Get-EntraUserDirectReport -UserId 'SawyerM@contoso.com' -All |
Select-Object Id, displayName, userPrincipalName, createdDateTime, accountEnabled, userType |
Format-Table -AutoSize
id displayName userPrincipalName createdDateTime accountEnabled userType
-- ----------- ----------------- --------------- -------------- --------
bbbbbbbb-1111-2222-3333-cccccccccccc Christie Cline ChristieC@Contoso.com 10/7/2024 12:32:25 AM True Member
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Isaiah Langer IsaiahL@Contoso.com 10/7/2024 12:33:16 AM True Member
此示例演示如何检索Microsoft Entra ID用户的所有直接报告。
-
-UserId参数指定用户的 ID(UserPrincipalName 或 UserId)。
示例 3:获取前两个直接报表
Get-EntraUserDirectReport -UserId 'SawyerM@contoso.com' -Top 2 |
Select-Object Id, displayName, userPrincipalName, createdDateTime, accountEnabled, userType |
Format-Table -AutoSize
id displayName userPrincipalName createdDateTime accountEnabled userType
-- ----------- ----------------- --------------- -------------- --------
bbbbbbbb-1111-2222-3333-cccccccccccc Christie Cline ChristieC@Contoso.com 10/7/2024 12:32:25 AM True Member
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Isaiah Langer IsaiahL@Contoso.com 10/7/2024 12:33:16 AM True Member
此示例演示如何检索Microsoft Entra ID用户的前五个直接报告。 您可以将 -Limit 用作 -Top 的别名。
-
-UserId参数指定用户的 ID(UserPrincipalName 或 UserId)。
参数
-All
列出所有页面。
参数属性
| 类型: | System.Management.Automation.SwitchParameter |
| 默认值: | False |
| 支持通配符: | False |
| 不显示: | False |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Property
指定要返回的属性。
参数属性
| 类型: | System.String[] |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
| 别名: | Select |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | False |
| 来自管道的值(按属性名称): | False |
| 来自剩余参数的值: | False |
-Top
指定要返回的最大记录数。
参数属性
| 类型: | System.Int32 |
| 默认值: | None |
| 支持通配符: | False |
| 不显示: | False |
| 别名: | Limit |
参数集
(All)
| Position: | Named |
| 必需: | False |
| 来自管道的值: | True |
| 来自管道的值(按属性名称): | True |
| 来自剩余参数的值: | False |
-UserId
指定Microsoft Entra ID中用户的 UserPrincipalName 或 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。