Get-EntraUserDirectReport
Get the user's direct reports.
Syntax
Get-EntraUserDirectReport
-UserId <String>
[-All]
[-Top <Int32>]
[-Property <String[]>]
[<CommonParameters>]
Description
The Get-EntraUserDirectReport
cmdlet gets the direct reports for a user in Microsoft Entra ID. Specify UserId
parameter gets the direct reports for a user.
Examples
Example 1: Get a user's direct reports
Connect-Entra -Scopes 'User.Read','User.Read.All'
Get-EntraUserDirectReport -UserId 'SawyerM@contoso.com'
Id DeletedDateTime
-- ---------------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb
bbbbbbbb-1111-2222-3333-cccccccccccc
cccccccc-2222-3333-4444-dddddddddddd
dddddddd-3333-4444-5555-eeeeeeeeeeee
This example demonstrates how to retrieve direct reports for a user in Microsoft Entra ID.
-UserId
Parameter specifies the ID of a user (UserPrincipalName or UserId).
Example 2: Get all direct reports
Connect-Entra -Scopes 'User.Read','User.Read.All'
Get-EntraUserDirectReport -UserId 'SawyerM@contoso.com' -All
Id DeletedDateTime
-- ---------------
bbbbbbbb-1111-2222-3333-cccccccccccc
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb
This example demonstrates how to retrieve all direct reports for a user in Microsoft Entra ID.
-UserId
parameter specifies the ID of a user (UserPrincipalName or UserId).
Example 3: Get a top two direct reports
Connect-Entra -Scopes 'User.Read','User.Read.All'
Get-EntraUserDirectReport -UserId 'SawyerM@contoso.com' -Top 2
Id DeletedDateTime
-- ---------------
bbbbbbbb-1111-2222-3333-cccccccccccc
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb
This example demonstrates how to retrieve top five direct reports for a user in Microsoft Entra ID.
-UserId
parameter specifies the ID of a user (UserPrincipalName or UserId).
Parameters
-All
List all pages.
Type: | System.Management.Automation.SwitchParameter |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Property
Specifies properties to be returned.
Type: | System.String[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Top
Specifies the maximum number of records to return.
Type: | System.Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-UserId
Specifies the ID of a user's UserPrincipalName or UserId in Microsoft Entra ID.
Type: | System.String |
Aliases: | ObjectId |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |