The Update-MgUserPassword command is used in Microsoft Graph PowerShell to update the password of a user account in Microsoft Entra ID. This cmdlet allows users to update their own passwords without requiring administrative roles. This self-service feature reduces dependency on IT teams and enhances security by allowing users to manage their credentials independently.
Before using the Update-MgUserPassword cmdlet, ensure the following prerequisites are met:
Install-Module Microsoft.Graph -Scope CurrentUser
Here's how you can use the Update-MgUserPassword cmdlet to change Entra ID passwords:
Update-MgUserPassword
-UserId <String>
[-ResponseHeadersVariable <String>]
[-AdditionalProperties <Hashtable>]
[-CurrentPassword <String>]
[-NewPassword <String>]
[-Headers <IDictionary>]
[-PassThru]
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
$params = @{
currentPassword = "ryTG67@3rygjh"
newPassword = "j739YteRpo#7789"
}
Update-MgUserPassword -UserId $userId -BodyParameter $params
The following table lists some parameters that can be used along with the Update-MgUserPassword cmdlet:
| Parameters | Description |
|---|---|
| -CurrentPassword | This parameter allows you to specify your existing password for verification. |
| -NewPassword | This parameter allows you to specify the new password that you would like to set. |
| -UserId | This parameter allows you to specify the user ID, such as the UserPrincipalN ame, object ID, or other identifiers. |
| -Confirm | This parameter asks for confirmation before executing the cmdlet. |
While Graph PowerShell allows users to update their own passwords using the Update-MgUserPassword cmdlet, it has several limitations:
ADManager Plus, an IGA solution with Microsoft 365 management and reporting capabilities, helps administrators overcome the common limitations of Graph PowerShell. By offering an intuitive interface, automation features, and advanced reporting capabilities, ADManager Plus enables efficient, streamlined user management in Entra ID.