Microsoft Security | Microsoft Graph
An API that connects multiple Microsoft services, enabling data access and automation across platforms
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I would like to know if there's any way to reset specific users passwords programatically, probably via Microsoft Graph.
I've tried to use application registrations, roles and administrative units, but without success. Any tips to implement this? Is this even possible?
<Moved from Office/Access>
Yes, you can reset specific users' passwords programmatically using Microsoft Graph. Here’s a general approach to do this:
User.ReadWrite.All permission. POST https://graph.microsoft.com/v1.0/users/{userId}/authentication/passwordMethods/{passwordMethodId}/resetPassword
Content-Type: application/json
{
"newPassword": "YourNewTemporaryPassword"
}
Replace {userId} with the user's ID or user principal name and {passwordMethodId} with the ID of the password method you are targeting. POST https://graph.microsoft.com/v1.0/users/{userId}/authentication/passwordMethods/{passwordMethodId}/resetPassword
Make sure to handle the necessary authentication and authorization steps in your application to successfully call the Microsoft Graph API.
References: