How to get direct reports of a user in Microsoft Entra ID using Get-MgUserDirectReport

Getting direct reports of a user in Microsoft Entra ID

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.

  • ADManager Plus
  • PowerShell
 

List direct reports of a user in Microsoft Entra ID using ADManager Plus

  1. Log in to ADManager Plus and navigate to Microsoft 365 > Reports > User Reports.
  2. Under General User Reports, click Microsoft 365 Users.
  3. Select the desired Microsoft 365 tenant from the Microsoft Tenant drop-down list.
  4. Select the desired groups or domains whose users you would like to fetch in the Filter By pop-up and click Generate.
  5. The direct reports of a user can be found under the Direct Reports column.
Get direct reports of a user in Microsoft Entra ID using ADManager Plus' predefined reports
 
 

Export reports in multiple formats, including HTML, CSV, and PDF.

 
 

Schedule automatic report generation.

Get direct reports of a user in Microsoft Entra ID using Microsoft Graph PowerShell

Prerequisites

Before using the Get-MgUserDirectReport cmdlet, ensure the following:

  • The Microsoft Graph PowerShell module is installed. If not, install it using this script:
    Install-Module Microsoft.Graph -Scope CurrentUser
  • Connect to Microsoft Graph PowerShell with the required permissions to fetch a user's direct reports in Microsoft Entra ID with this script:
    Connect-MgGraph -Scopes "User.Read.All"

Using the Get-MgUserDirectReport command to get a user's direct reports in Microsoft Entra ID

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>]

An example use case using the Get-MgUserDirectReport cmdlet

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.

Supported parameters

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.

Limitations of using Graph PowerShell scripts to get direct reports of a user in Microsoft Entra ID

  • Graph PowerShell requires IT admins to upgrade from Azure AD PowerShell and have familiarity with PowerShell scripting.
  • The Microsoft Graph API imposes throttling limits, which may affect performance when fetching direct reports of a user in bulk.
  • The scripts may require extra effort to format and export data for reporting purposes.
  • Technical expertise is needed to troubleshoot errors.
  • The lack of an intuitive interface makes the overall experience less user-friendly, particularly for those new to scripting.

Highlights of using ADManager Plus to get direct reports of a user in Microsoft Entra ID

  • Intuitive interface that streamlines the report generation process.
  • Comprehensive and customizable reports with options to schedule and automate report generation.
  • Supports on-the-fly management actions to manage users instantly.
  • Optimized for large-scale environments and does not require any scripts for bulk operations.
  • Delegate tasks to technicians without elevating their native privileges.
  • Keep a watchful eye on your IT environment with more than 200 pre-packaged reports.
  • Export reports in various formats, such as CSV or HTML, in a few clicks.

Get the direct reports of a user in Microsoft Entra ID effortlessly with ADManager Plus

 
  • Fetch direct reports of a user in Microsoft Entra ID using ADManager Plus
  • Get direct reports of a user in Microsoft Entra ID using Microsoft Graph PowerShell
  • Limitations of using Graph PowerShell scripts to get direct reports of a user in Microsoft Entra ID
  • Highlights of using ADManager Plus to get direct reports of a user in Microsoft Entra ID
The one-stop solution to Active Directory Management and Reporting
Email Download Link