How to update Entra ID users using the Update-MgUser cmdlet in Microsoft Graph PowerShell

Managing Microsoft Entra ID users

Updating user attributes in Microsoft Entra ID—such as job titles, departments, or contact details—is a common task for IT teams. While the Update-MgUser cmdlet from Microsoft Graph PowerShell can perform these updates, it requires scripting knowledge, attention to syntax, and administrative permissions.

ADManager Plus, on the other hand, provides a hassle-free, GUI-based approach for modifying user attributes in bulk or individually. It supports bulk-management options, automation capabilities, and more to make the update process faster, safer, and more efficient.

  • ADManager Plus
  • PowerShell
 

Updating Microsoft Entra ID users using ADManager Plus

  1. Log in to ADManager Plus and go to Microsoft 365 > Management > User Management.
  2. Select the desired action from the options displayed under Bulk User Modification.
  3. Configure the selected attribute. For example, if you've selected the Reset Password option in step 2, configure the users' password properties in this step.
  4. Choose your tenant and select users by either searching or uploading a CSV file with a list of users whose attributes you would like to modify.
  5. Click Apply to update users in bulk.
Update Microsoft Entra ID user attributes using ADManager Plus’ user-friendly GUI

Update-MgUser cmdlet in Microsoft Graph PowerShell

Prerequisites

Before using the Update-MgUser cmdlet:

  • Ensure the Microsoft Graph PowerShell module is installed. If not, install it using this script:
    Install-Module Microsoft.Graph -Scope CurrentUser
  • Connect to Microsoft Graph PowerShell with the required permissions to modify user attributes.
    Connect-MgGraph -Scopes "User.ReadWrite.All"

Using the Update-MgUser cmdlet

This cmdlet modifies attributes of a user in Microsoft Entra ID:

Update-MgUser -UserId "<userPrincipalName>" -Department "Marketing"

Examples

Example 1: Update a user’s department and title

Update-MgUser -UserId "John@zkyy.com" -Department "Sales" -JobTitle "Sales Manager"

Example 2: Change a user’s office location

Update-MgUser -UserId "Vance@zkyy.com" -OfficeLocation "ZKY Building"

Example 3: Disable a user account

Update-MgUser -UserId "Kevin@zkyy.com" -AccountEnabled $false

Supported parameters

Parameters Description
-UserId This parameter is used to specify the unique identifier of the user to update.
-Department This parameter updates the department of the user.
-JobTitle This parameter modifies the job title.
-MobilePhone This parameter updates the user’s mobile number.
-AccountEnabled This parameter enables or disables the user account.

Limitations of using Graph PowerShell scripts for managing Microsoft Entra ID users

  • Requires scripting experience and familiarity with parameter syntax.
  • Doesn’t support rule-based updates or templates.
  • Lacks an intuitive interface, increasing the risk of human error.
  • Not ideal for bulk updates unless combined with external CSVs and loops.
  • Troubleshooting errors in scripts requires deep technical knowledge.

Highlights of using ADManager Plus to manage Microsoft Entra ID users

  • Modify user attributes such as department, passwords, and job titles in bulk using CSV files.
  • Automate routine tasks, including onboarding, offboarding, and license assignment.
  • Generate reports on user account status, password expiry, inactive accounts, and more, so you can manage users on the fly.
  • Delegate user management tasks to help desk technicians with granular control.

Manage Microsoft Entra ID users in a few clicks with ADManager Plus

 
  • Managing Microsoft Entra ID users
  • Updating Microsoft Entra ID users using ADManager Plus
  • Update-MgUser cmdlet in Microsoft Graph PowerShell
  • Limitations of using Graph PowerShell scripts to generate Entra ID reports
  • Advantages of using ADManager Plus to generate Entra ID reports
The one-stop solution to Active Directory Management and Reporting
Email Download Link