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.
Before using the Remove-MgUserManagerByRef cmdlet, ensure the following prerequisites are met:
Install-Module Microsoft.Graph -Scope CurrentUser
User.ReadWrite.All, Directory.ReadWrite.All,
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>]
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. |
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: