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' |
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
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 |
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
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
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
This example demonstrates how to retrieve top five direct reports for a user in Microsoft Entra ID. You can use -Limit
as an alias for -Top
.
-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[] |
Aliases: | Select |
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 |
Aliases: | Limit |
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 |