Updated 3 months ago

Export Office 365 User Manager and Direct Reports Using PowerShell

by Elora

6 min read

No Comments

The objective of a Microsoft 365 Admin is to keep the data up to date. But, assigning a manager and retrieving their information has always been one of the tedious tasks.. The manager data is the significant component to create the organization chart. As various services depend on this data, it is necessary to regularly verify the manager and direct report information.

How to View Microsoft 365 User’s Manager Details:

Find Microsoft 365 user’s manager from admin center:

You can view the Office 365 users’ manager name in the Microsoft 365 admin center.

  1. Go to Microsoft 365 admin center
  2. Select the ‘Active users’ under “Users”
  3. Click on the user. In the profile, you can view the ‘Manager’ details.

However, getting a manager report in Microsoft 365 is an effort-consuming task as you can see the result of one user at a time.

View M365 user’s manager using PowerShell:

You can use PowerShell cmdlet Get-AzureADUserManager and Get-AzureADUserDirectReport to get the managers and direct reports information. But due to Azure AD PowerShell module deprecation, you need to switch to MS Graph or Microsoft Entra PowerShell cmdlets like Get-MgUserDirectReport and Get-EntraUserDirectReport. Also, you need to call the Get-MgUser cmdlet to get the user information. It isn’t easy when you want to generate different reports to meet your business requirements.

So, most admins prefer to use tools like AdminDroid, which provides 120+ free reports, including manager reports.

If you are a PowerShell lover, no worries. we have created a multipurpose script, GetM365ManagerAndDirectReports.ps1′. We can discuss the script’s functionalities in detail now.

Script Highlights:
  • Generates 10+ different manager reports to view the managers and direct reports status.
  • Automatically installs MS Graph PowerShell module upon your confirmation when it is not available in your machine.
  • Shows list of all Azure AD users and their manager.
  • List of all Office 365 users with no manager.
  • Allows specifying user departments to get their manager details.
  • You can get the direct reports of the Office 365 managers.
  • Supports both MFA and Non-MFA accounts.
  • Exports the report in CSV format.
  • Scheduler-friendly. You can automate the report generation upon passing credentials as parameters.

Office 365 User Manager Report – Script Execution Overview

The administrators need different types of managers’ reports to address business requirements and management activities. You can run the script with a simple execution format to get various user manager reports. Following manager reports that contain detailed attributes of both users and managers.

You can filter ‘DisabledUsers’ and ‘UnlicensedUsers’ using the switch params which are discussed in the ‘More use cases’ section. These filters help to unlock the script’s full potential. We have explained the steps to supply inputs and generating reports below.

Get Office 365 Users and Their Manager:

The Office 365 users are assigned to a manager while processing their organization profile. The manager may change based on the user role and other factors. The administrators monitor the users’ manager info to ensure the profile is updated correctly. Using our script, you can get the list of users and their manager’s name along with the significant attributes.

The exported Office 365 user manager report contains both users’ and managers’ information like Name, UPN, Department, Account Status and License Status.

Sample Output:

Get Office 365 users with manger

Get Office 365 Users Without Manager:

There are specific business sectors where the users don’t have a manager to report. These users can belong to any department or user category (like guest). They don’t need managers as their role in the organization is distinct. Using our script, the administrators can quickly identify users who don’t have a manager and verify their accounts. The switch param ‘UsersWithoutManager’ is used to get the users without the manager report.

The report has essential user account attributes that help the administrator decide the necessity to set up managers for them.

Sample Output:

Get all Azure AD users without manager

Get Office 365 Managers and Direct Reports:

Manager and their direct report data is a significant report frequently requested to Admins. This data is used to construct the organization chart effectively. Using the ‘DirectReports’ switch, you can get managers and their direct reports information in a Jiffy.

The format shown above provides a list of managers and their direct reports. Also, the report shows how many direct reports the managers have, along with the direct reports names and UPNs.

Sample Output:

Get Office 365 manager and their direct reports

Find Office 365 Users’ Manager by Department:

Department managers are the driving force behind a department’s growth through achieving high levels of productivity. The administrators confirm that the department managers are available to deliver business updates. When your tenant has a large user population, you can generate manager reports based on department filters to save time.

Using the ‘Department’ parameter, you can view the users available in the specific departments and their manager details.

Specifying the list of departments enclosed with quotes and separated with a comma is essential. Mention the departments of the users in the input to know their manager’s data.

Sample Output:

Find Office 365 user department managers information

Get Manager Detail of Disabled Users:

The admin regulates the users’ off-boarding activities. These user accounts are retained as disabled accounts to preserve the data for the compliance requirements.

You can use the ‘DisabledUsers’ param to generate disabled users’ manager reports.

The report has only disabled users and their manager information.

Get Office 365 Unlicensed Users and Their Managers:

Every Office 365 user must have at least one license to continue their work. It’s the administrators’ responsibility to make sure all users are licensed properly. The administrator assigns proper licenses to the user after confirming with the manager. Using the unlicensed users’ manager report, the administrator identifies the manager to get the license suggestions for these users.

Using the ‘UnlicensedUsers’ param, you can get only unlicensed users and their managers.

Scheduling Office365 Users’ Manager and Direct Reports:

Based on organization functionalities, you can schedule the PowerShell script to monitor the daily or periodic status of the user and manager report. To schedule the execution, you can use certificate based authentication

To use certificates, you must register the app in Entra ID and use either a CA certificate or create a self-signed SSL certificate.

Office 365 User Manager Report – Additional Use Cases:

You can append the ‘-Disabled Users’ or ‘-UnlicensedUsers’ or both params with other parameters to filter the results further. Below are some examples to granularly filter the results.

  • Get manager info of disabled users who don’t have an Office 365 license.

  • View direct reports of disabled managers who don’t have an Office 365 license.

  • List disabled users who don’t have an Office 365 license and a manager.

  • Get users from different departments who don’t have a manager.

  • Get direct reports of managers in a department.

AdminDroid: Free Tool for Detailed Office 365 Manager Reports:

Why AdminDroid is one-stop solution for Microsoft 365 manager reporting?
  • Schedules and sends reports to email
  • Exports data in various formats, such as CSV, HTML, PDF, etc.
  • Filters data to generate fine-grained reports
  • Visualizes report data to charts/AI generated graphs
  • Manages multiple tenants
  • User friendly UI
  • Manager and other 100+ Azure AD reports available in Free Edition itself.

AdminDroid offers a free Office 365 reporting tool that provides detailed reports on Office 365 managers and direct reports.

Azure AD manager report by AdminDroid

Microsoft 365 managers and direct reports

In addition to this, the Office 365 reporting software includes a range of Office 365 dashboards and the following reports at no extra cost:

  • User reports, group reports, and group membership reports
  • Subscription and license reports
  • User login activity monitoring
  • License changes, password changes, group membership changes, and more.

AdminDroid goes beyond just Office 365 reporting – it also provides 1800+ reports and 30+ smart dashboards that deliver valuable insights into every aspect of your Microsoft 365 environment, including reporting, auditing, analytics, usage & adoption statistics, security, and compliance. You can also get alerts on critical M365 activities.

Download Microsoft 365 reporting tool and experience the power of AdminDroid’s reporting and auditing capability.

We hope this script helps to get the users’ manager report and managers’ direct reports effectively. If there is still something unclear to you, please leave a comment, and we will address your questions.

Share article