How to remove a user's manager in Microsoft Entra ID using Microsoft Graph PowerShell

When users and contacts change roles or leave the company, their reporting structures change. Removing or updating a manager in Microsoft Entra ID ensures that the directory accurately reflects the current organizational hierarchy. Microsoft Graph PowerShell helps you remove a manager using the Remove-MgUserManagerByRef cmdlet. ADManager Plus helps you do the same but with a CSV file import, allowing you to remove managers for dozens of users simultaneously.

  • ADManager Plus
  • PowerShell
 

Remove an Entra ID contact's manager using ADManager Plus

  1. Log in to the ADManager Plus admin console.
  2. Navigate to Microsoft 365 > Management > Contact Management > Contact Attribute Changes.
  3. Upload a CSV file with the correct headers. You can refer to the sample CSV file in the UI for guidance. You may choose to update your contact's manager or remove them.
  4. Click Import Contact(s).
Removing contacts' managers in Entra ID using ADManager Plus

Removing a user's manager using Graph PowerShell

Prerequisites

Before using the Remove-MgUserManagerByRef cmdlet, ensure the following prerequisites are met:

  • If the Graph PowerShell module is not installed, install it using this script:
    Install-Module Microsoft.Graph -Scope CurrentUser
  • Connect to Graph PowerShell with the following permissions (from the least to most privileged) to remove a user's manager:
    User.ReadWrite.All, Directory.ReadWrite.All,

Using the Remove-MgUserManagerByRef cmdlet

Run the following cmdlet in Graph PowerShell to remove a user's manager:

Remove-MgUserManagerByRef
-UserId <String>
[-IfMatch <String>]
[-ResponseHeadersVariable <String>]
[-Headers <IDictionary>]
[-PassThru]
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]

Supported parameters

The following are some essential parameters that can be used along with the Remove-MgUserManagerByRef command:

Parameters Description
-Confirm This parameter prompts you for confirmation before running the cmdlet.
-Headers This parameter allows you to add optional headers to the request.
-PassThru This parameter returns true when the command succeeds.
-UserId This parameter displays the unique identifier of the user.
-WhatIf This parameter shows what will happen if the cmdlet runs.

Limitations of using Graph PowerShell to remove a user's manager

  • PowerShell scripts can get complicated with different use cases and scenarios.
  • IT admins can spend a lot of time debugging errors, which in turn negatively impacts productivity.
  • Delegation can get tricky since technicians require elevated permissions.

How ADManager Plus helps manage users, contacts, and more

ADManager Plus is an identity governance and administration solution with comprehensive Entra ID management and reporting capabilities. It simplifies complex admin tasks through a single, user-friendly console:

  • Manage users, contacts, groups, licenses, and other Entra ID objects with a script-free, centralized console.
  • Reduce human error by automating and orchestrating tasks such as user provisioning, deprovisioning, and license assignment across various platforms.
  • Delegate tasks to technicians without elevating their native privileges.
  • Keep a watchful eye on your IT environment with more than 200 prepackaged reports.
  • Monitor delegated activities through smart workflows.
  • Ensure business continuity with AD, Entra ID, and Google Workspace backup and recovery.

Perform script-free Entra ID management and reporting with ADManager Plus

 
  • Remove an Entra ID contact's manager using ADManager Plus
  • Removing a user's manager using Graph PowerShell
  • Limitations of using Graph PowerShell to remove a user's manager
  • How ADManager Plus helps you manage Entra ID
The one-stop solution to Active Directory Management and Reporting
Email Download Link Email the ADManager Plus download link