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:
- Note down the required parameters (ObjectId, RefObjectId, InformationAction, InformationVariable, and other CommonParameters) for updating the user's manager.
- 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:
- Log in to ADManager Plus and navigate to the Microsoft 365 tab > Management > User Management.
- Under Bulk User Modification, click Set Manager.
- Click the plus icon to select the manager.
- Select the desired Microsoft 365 tenant from the Microsoft 365 Tenant drop-down.
- Find the users for whom the manager has to be updated.
- Click Apply. The selected user's manager will be set.
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.