Get-EntraUserDirectReport

取得使用者的直接下屬。

語法

Default (預設值)

Get-EntraUserDirectReport

    -UserId <String>
    [-All]
    [-Top <Int32>]
    [-Property <String[]>]
    [<CommonParameters>]

Description

指令Get-EntraUserDirectReport小程式會直接接收 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)。

範例二:取得所有直屬下屬

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)。

範例三:找兩位前兩名的直屬下屬

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
別名:選取

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-Top

指定回傳的最大紀錄數量。

參數屬性

類型:System.Int32
預設值:None
支援萬用字元:False
不要顯示:False
別名:極限

參數集

(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。