Reset a user's password, represented by a password authentication method object. This can only be done by an administrator with appropriate permissions and cannot be performed on a user's own account.
This flow writes the new password to Azure Active Directory and pushes it to on-premises Active Directory if configured using password writeback. The admin can either provide a new password or have the system generate one. The user is prompted to change their password on their next sign in.
This reset is a long-running operation and will return a Location header with a link where the caller can periodically check for the status of the reset operation.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Important
The operation cannot be performed on a user's own account. Only an administrator with the appropriate permissions can perform this operation.
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
UserAuthenticationMethod.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
Not supported.
For delegated scenarios, the administrator needs the Authentication Administrator or Privileged Authentication AdministratorAzure AD role.
HTTP request
POST /users/{id | userPrincipalName}/authentication/methods/{id}/resetPassword
Request headers
Name
Description
Authorization
Bearer {token}. Required.
Content-type
application/json. Required.
Request body
In the request body, provide a JSON object with the following parameters.
Parameter
Type
Description
newPassword
String
The new password. Required for tenants with hybrid password scenarios. If omitted for a cloud-only password, the system returns a system-generated password. This is a unicode string with no other encoding. It is validated against the tenant's banned password system before acceptance, and must adhere to the tenant's cloud and/or on-premises password requirements.
Response
If successful, this method returns a 202 Accepted response code and a passwordResetResponse in the response body. The response body may also include a Location header with a URL to check the status of the reset operation.
If the caller did not submit a password, a Microsoft-generated password is provided in a JSON object in the response body.
Response headers
Name
Description
Location
URL to call to check the status of the operation. Required.
Retry-after
Duration in seconds. Optional.
Examples
Example 1: User-submitted password
The following example shows how to call this API when the caller submits a password.
POST https://graph.microsoft.com/v1.0/users/6ea91a8d-e32e-41a1-b7bd-d2d185eed0e0/authentication/methods/28c10230-6103-485e-b985-444c60001490/resetPassword
Content-type: application/json
{
"newPassword": "Cuyo5459"
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Microsoft.Graph.Users.Item.Authentication.Methods.Item.ResetPassword.ResetPasswordPostRequestBody
{
NewPassword = "Cuyo5459",
};
var result = await graphClient.Users["{user-id}"].Authentication.Methods["{authenticationMethod-id}"].ResetPassword.PostAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new ResetPasswordPostRequestBody();
$requestBody->setNewPassword('Cuyo5459');
$result = $graphServiceClient->users()->byUserId('user-id')->authentication()->methods()->byMethodId('authenticationMethod-id')->resetPassword()->post($requestBody);
POST https://graph.microsoft.com/v1.0/users/6ea91a8d-e32e-41a1-b7bd-d2d185eed0e0/authentication/methods/28c10230-6103-485e-b985-444c60001490/resetPassword
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var result = await graphClient.Users["{user-id}"].Authentication.Methods["{authenticationMethod-id}"].ResetPassword.PostAsync(null);
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$result = $graphServiceClient->users()->byUserId('user-id')->authentication()->methods()->byMethodId('authenticationMethod-id')->resetPassword()->post();