How to update a user's manager using PowerShell scripts

An Azure Active Directory (AD) manager refers to an individual who holds a managerial position in the organization. The manager's role primarily deals with organization hierarchy, access control, and delegation. If there is a change in the management structure, updating the manager for a particular user in Azure AD allows the organization to reflect the current management hierarchy accurately. ADManager Plus, a unified Active Directory, Microsoft 365, Exchange, and Google Workspace management and reporting tool, can also be used to accomplish this task. The cmdlet in the table below can be used to remove a user's manager in Azure AD.

The following table is a comparison on how to update a user's manager in Azure AD using PowerShell scripts and ADManager Plus.

Azure PowerShell

Steps to update a user's manager using PowerShell scripts:

  1. Note down the required parameters (ObjectId, RefObjectId, InformationAction, InformationVariable, and other CommonParameters) for updating the user's manager.
  2. Execute the following PowerShell script with the required parameters and their values.
 Copied
Set-AzureADUserManager
-ObjectId <ObjectId>
-RefObjectId <RefObjectId>
[-InformationAction <ActionPreference>]
[-InformationVariable <var>]
[<CommonParameters>]
Click to copy entire script

Where <ObjectId> refers to the ID of the user, <RefObjectId> refers to the ID of the Azure AD object that is to be designated as the owner, manager, or member, <ActionPreference> describes the way in which this cmdlet reacts to an information event, and refers to the information variable.

ADManager Plus:

Steps to update a user's manager using ADManager Plus:

  1. Log in to ADManager Plus and navigate to the Microsoft 365 tab > Management > User Management.
  2. Under Bulk User Modification, click Set Manager.
  3. Click the plus icon to select the manager.
  4. Select the desired Microsoft 365 tenant from the Microsoft 365 Tenant drop-down.
  5. Find the users for whom the manager has to be updated.
  6. Click Apply. The selected user's manager will be set.
How to update a user's manager using PowerShell scripts
 

Limitations of using PowerShell scripts to update a user's manager

  • Only technicians with PowerShell expertise can execute this command.
  • PowerShell scripts are time-consuming and can affect productivity.
  • To remove multiple managers, administrators should run the above mentioned script individually.

Benefits of using ADManager Plus:

  • ADManager Plus' user management features streamlines user provisioning, modification, and deprovisioning processes, saving administrators time and effort.
  • ADManager Plus comes with an intuitive UI and does not demand extensive knowledge of PowerShell.
  • Management actions come built-in with ADManager Plus and can be performed at the click of a button.
  • ADManager Plus' automation feature reduces manual error and ensures consistency across the Active Directory environment.

Simplify Azure AD management and reporting with ADManager Plus

  Get 30-day free trial.
  • Embark on your script-free AD management, reporting, and automation journey with ADManager Plus.
  •  
  • By clicking 'Start your free trial now', you agree to processing of personal data according to the Privacy Policy.
  • Thanks
  • Your download should begin automatically in 15 seconds. If not, click here to download manually.

Related Powershell How-to Guides:

The one-stop solution toActive Directory Management and Reporting

Email Download Link