IT admins are often tasked with finding the direct reports of a user for compliance and audit purposes. While Graph PowerShell's Get-MgUserDirectReport command, an alternative to the Get-AzureADUserDirectReport command, can be used to obtain and export direct reports of a user in Microsoft Entra ID, its complexity and non-intuitive interface make it a challenging option. On the other hand, ADManager Plus, a Microsoft 365 management and reporting tool, simplifies the process, allowing admins to quickly generate and export the direct reports of a user in just a few clicks.
Export reports in multiple formats, including HTML, CSV, and PDF.
Schedule automatic report generation.
Before using the Get-MgUserDirectReport cmdlet, ensure the following:
Install-Module Microsoft.Graph -Scope CurrentUser
Connect-MgGraph -Scopes "User.Read.All"
The Get-MgUserDirectReport cmdlet can be used in Microsoft Graph PowerShell to fetch a user's direct reports in Microsoft Entra ID. Here's the syntax:
Get-MgUserDirectReport
-UserId <String>
[-ExpandProperty <String[]>]
[-Property <String[]>]
[-Filter <String>]
[-Search <String>]
[-Skip <Int32>]
[-Sort <String[]>]
[-Top <Int32>]
[-ConsistencyLevel <String>]
[-ResponseHeadersVariable <String>]
[-Headers <IDictionary>]
[-PageSize <Int32>]
[-All]
[-CountVariable <String>]
[-ProgressAction <ActionPreference>]
[<CommonParameters>]
Listing all the direct reports of a particular user
Get-MgUserDirectReport -UserId <'user_id'>
In this command, replace user_id with the user's ID for whom you would like to list all the direct reports.
The following table contains some parameters that can be used along with the Get-MgUserDirectReport command to fetch the direct reports of a user in Microsoft Entra ID efficiently.
| Parameters | Description |
|---|---|
| -All | This parameter retrieves all direct reports of a user without default pagination limits. |
| -Filter | This parameter filters direct reports of a user based on attributes and values. |
| -UserId | This parameter retrieves direct reports of a user based on their unique identifiers, such as user principal name or object ID. |
| -Property | This parameter retrieves specific attributes of direct reports of a user. |