How to Bulk-Change User Managers in Microsoft Entra ID
Question details
An administrator needs a method to update the manager attribute for multiple users in Microsoft Entra ID (formerly Azure AD) simultaneously.

- Product
- Microsoft Entra ID
- Device & OS
- not provided
- Scenario
- Updating organization hierarchy or bulk assigning managers for multiple existing Microsoft 365 or Azure users without updating each profile manually.
- Observed behavior
- The administrator is looking for a graphical portal (GUI) option to perform bulk manager updates, seeking an alternative to writing scripts and commands.
Ensure you have the User Administrator or Global Administrator role in Microsoft Entra ID and prepare a CSV file mapping each user's User Principal Name (UPN) to their new manager's UPN.
Bulk Update Managers Using Microsoft Graph PowerShell and CSV
Since the Microsoft 365 and Entra admin centers do not provide a built-in graphical interface for bulk updating managers, utilizing a CSV file mapped through a Microsoft Graph PowerShell script is the most efficient and officially supported method.
The graphical portal for Microsoft Entra ID currently does not support bulk-changing the manager attribute for multiple users simultaneously. Administrators must rely on Microsoft Graph PowerShell scripts paired with a CSV file to execute these changes programmatically at scale.
Create a CSV file with two distinct columns: 'UserUPN' (containing the email addresses of the users being updated) and 'ManagerUPN' (containing the email addresses of their respective new managers).
Open PowerShell as an Administrator and execute the command 'Connect-MgGraph -Scopes User.ReadWrite.All' to securely authenticate with your Microsoft Entra environment.
Load the CSV file into your PowerShell session by using the 'Import-Csv' cmdlet, assigning it to a variable (e.g., $users = Import-Csv -Path 'C:\path\to\file.csv').
Write a 'foreach' loop to iterate through the CSV data. Within the loop, retrieve the user and manager object IDs based on their UPNs, then execute the 'Set-MgUserManagerByRef' cmdlet to finalize the manager assignment for each user.

Manage Your Entra ID CSV Mapping Files Effortlessly with WPS Office
Preparing your user and manager mapping CSV files for PowerShell scripts requires a reliable spreadsheet editor. WPS Office offers a free, lightweight, and fully compatible alternative to Microsoft Office, perfect for managing administrative CSV datasets without the heavy overhead.
- 1. Open WPS Spreadsheet: Launch WPS Office and open a new blank spreadsheet.
- 2. Set up your columns: Type 'UserUPN' in cell A1 and 'ManagerUPN' in cell B1 to set up your directory mapping headers.
- 3. Save as CSV: Enter your organizational data, go to Menu > Save As, and choose 'CSV (Comma delimited)' to generate the file needed for your PowerShell script.

Frequently Asked Questions
Can I use the Microsoft 365 Admin Center GUI to bulk change managers?
No, the Microsoft 365 Admin Center and the Microsoft Entra admin portal currently only allow changing the manager attribute on an individual user basis. Bulk changes require PowerShell or Graph API.
What administrator roles are required to update user managers in Entra ID?
You need to be assigned the User Administrator or Global Administrator role within Microsoft Entra ID to have the necessary permissions to modify user manager attributes.
Why do I receive an error when running Set-MgUserManagerByRef?
Errors typically occur if the provided User Principal Names (UPNs) in your CSV do not match active directory objects exactly, or if you failed to grant the 'User.ReadWrite.All' permission scope when initially connecting to Microsoft Graph.
Is the Set-AzureADUserManager command still recommended?
While 'Set-AzureADUserManager' was previously used, Microsoft has deprecated the AzureAD PowerShell module. Administrators are strongly advised to migrate to the Microsoft Graph PowerShell SDK for all user management scripts.




