---
title: "Update-MgUser: Change User Properties in Microsoft Graph"
meta_title: "Update-MgUser PowerShell: Examples, Permissions and Errors"
slug: update-mguser-powershell
published: 2026-11-26T00:00:00.000Z
updated: 2026-11-26T00:00:00.000Z
feature_image: /blog/images/update-mguser-powershell/update-mguser-syntax-microsoft-learn.1600.webp
feature_image_alt: Microsoft Learn documentation for the Update-MgUser cmdlet showing its description and syntax
author: James Futhey
author_slug: james
meta_description: "Update-MgUser changes a user's job title, phone, usage location, password policy and more in Microsoft Graph PowerShell. Examples, permissions and fixes."
status: published
---

**Quick answer:** connect to Microsoft Graph with a write scope, then run:

```powershell
Connect-MgGraph -Scopes "User.ReadWrite.All"
Update-MgUser -UserId ayla@contoso.com -JobTitle "Facilities Manager" -Department "Operations"
```

`-UserId` takes the user's object ID or their UPN. Properties you leave out keep their current values.

## What does Update-MgUser do?

It updates the properties of a user object in Microsoft Entra ID through Microsoft Graph.

| Cmdlet | Use it when |
|---|---|
| [Get-MgUser](/blog/use-get-mguser-powershell/) | You want to read a user's properties |
| Update-MgUser | You want to change them |
| [Set-MgUserLicense](/blog/set-mguserlicense-powershell/) | You want to add or remove a license |
| Set-MgUserManagerByRef | You want to set the user's manager |
| [Set-User](/blog/set-user-powershell/) | You want to change the same kind of details from Exchange Online PowerShell |

## Which permissions does Update-MgUser need?

For most properties, `User.ReadWrite.All` is enough. Microsoft lists `User.ReadUpdate.All` as the least privileged permission for the update call itself. A few properties need their own permission:

| Property | Least privileged permission |
|---|---|
| Most profile fields | User.ReadUpdate.All |
| AccountEnabled | User.EnableDisableAccount.All plus User.Read.All |
| BusinessPhones, MobilePhone | User-Phone.ReadWrite.All |
| OtherMails | User-Mail.ReadWrite.All |
| PasswordProfile | User-PasswordProfile.ReadWrite.All |
| Your own profile | User.ReadWrite |

Some of these properties are also sensitive actions. To change AccountEnabled, BusinessPhones, MobilePhone or OtherMails on an administrator, the signed-in user needs a higher admin role, such as Privileged Authentication Administrator. See [Connect-MgGraph](/blog/use-connect-mggraph-powershell/) for how to sign in with scopes.

## Examples

| Task | Command |
|---|---|
| Change the display name | `Update-MgUser -UserId ayla@contoso.com -DisplayName "Ayla Lee"` |
| Set job title, department and office | `Update-MgUser -UserId ayla@contoso.com -JobTitle "Facilities Manager" -Department "Operations" -OfficeLocation "Building 2"` |
| Set the usage location before licensing | `Update-MgUser -UserId ayla@contoso.com -UsageLocation US` |
| Set the office and mobile numbers | `Update-MgUser -UserId ayla@contoso.com -BusinessPhones "+1 425 555 0109" -MobilePhone "+1 425 555 0110"` |
| Block sign-in | `Update-MgUser -UserId ayla@contoso.com -AccountEnabled:$false` |
| Allow sign-in again | `Update-MgUser -UserId ayla@contoso.com -AccountEnabled` |
| Set the password to never expire | `Update-MgUser -UserId ayla@contoso.com -PasswordPolicies DisablePasswordExpiration` |
| Set the password to expire again | `Update-MgUser -UserId ayla@contoso.com -PasswordPolicies None` |
| Preview a change | Add `-WhatIf` |

`-AccountEnabled` is a switch, so write `-AccountEnabled:$false` with a colon to turn it off. Microsoft lists blocking sign-in this way as a first step when [responding to a compromised account](https://learn.microsoft.com/en-us/defender-office-365/responding-to-a-compromised-email-account).

UsageLocation is a two-letter country code such as US, JP or GB. A user needs one before you can assign a license.

BusinessPhones is a list, but it holds only one number.

## How do I reset a password with Update-MgUser?

Put the new password in a hash table and pass it with `-BodyParameter`:

```powershell
$params = @{
    passwordProfile = @{
        forceChangePasswordNextSignIn = $true
        password = $newPassword
    }
}
Update-MgUser -UserId ayla@contoso.com -BodyParameter $params
```

Microsoft recommends setting `forceChangePasswordNextSignIn` to `$true`. The password has to meet the user's password policy, and you can't set it this way for federated users. To reset a non-admin's password, the signed-in user needs at least the User Administrator role.

## How do I set an extension attribute?

ExtensionAttribute1 through ExtensionAttribute15 live in OnPremisesExtensionAttributes. These are the same as the Exchange custom attributes 1 to 15.

```powershell
Update-MgUser -UserId ayla@contoso.com -OnPremisesExtensionAttributes @{ ExtensionAttribute1 = "Room booking admin" }
```

For a user synced from on-premises Active Directory, these attributes are read-only in Graph. Change them on-premises instead.

## How do I update many users at once?

This follows Microsoft's example that sets the password policy for every user:

```powershell
Get-MgUser -All | ForEach-Object { Update-MgUser -UserId $_.Id -PasswordPolicies DisablePasswordExpiration }
```

To change a filtered set, narrow the [Get-MgUser](/blog/use-get-mguser-powershell/) call first, for example with `-Filter "department eq 'Sales'"`. Run it once with `-WhatIf` on the Update-MgUser call.

Microsoft warns that if you switch passwords from DisablePasswordExpiration back to None, any user whose password is older than 90 days must change it at their next sign-in.

## How do I set a user's manager?

The manager isn't one of the properties Update-MgUser changes. Use Set-MgUserManagerByRef with the manager's object ID:

```powershell
$manager = @{ "@odata.id" = "https://graph.microsoft.com/v1.0/users/075b32dd-edb7-47cf-89ef-f3f733683a3f" }
Set-MgUserManagerByRef -UserId ayla@contoso.com -BodyParameter $manager
```

## Why doesn't Update-MgUser work?

| Error or symptom | Fix |
|---|---|
| The term Update-MgUser is not recognized | Install the Microsoft.Graph.Users module and run `Connect-MgGraph`. |
| Insufficient privileges to complete the operation | Reconnect with the scope the property needs, from the permissions table above. |
| Fails only for admin accounts | AccountEnabled, phones, OtherMails and passwords on admins need a higher admin role. |
| Phone or extension attribute won't change | The user is synced from on-premises. Change it in Active Directory. |
| AboutMe or Skills fails when sent with other fields | AboutMe, Birthday, Interests, MySite, PastProjects, Responsibilities, Schools and Skills must each go in their own request. |
| Those same fields fail with app-only sign-in | They can't be updated with application permissions alone. Employee hire date can't either. |
| Mail can't be cleared | Mail can't be set to null. |
| OtherMails lost addresses | The new list replaces the old one. Pass every address the user should keep. |

## How do I check the result?

Many properties are only returned when you ask for them:

```powershell
Get-MgUser -UserId ayla@contoso.com -Property DisplayName,JobTitle,Department,UsageLocation,AccountEnabled,PasswordPolicies | Format-List DisplayName,JobTitle,Department,UsageLocation,AccountEnabled,PasswordPolicies
```

Sources: [Update-MgUser](https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.users/update-mguser), [Update user](https://learn.microsoft.com/en-us/graph/api/user-update) in the Microsoft Graph API reference, [Self-service password reset policies](https://learn.microsoft.com/en-us/entra/identity/authentication/concept-sspr-policy) and [Set-MgUserManagerByRef](https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.users/set-mgusermanagerbyref) on Microsoft Learn.

Meeting Room 365 turns any iPad or Android tablet into a room display for Exchange and Microsoft 365 calendars. See the [features](/features/) or [pricing](/pricing/): $9 a display a month.
