When resetting password via graph api , we are getting resource not found issue

tgulati 20 Reputation points
2024-10-28T06:49:52.88+00:00

Currently when i use list users or get users, revokes session APIs, all APIS are working fine without any issue, but when i try to reset the password i am getting below error, but users are available in that tenant , how to resolve? Pls help

Request_ResourceNotFound","message":"Resource '' does not exist or one of its queried reference-property objects are not present.",

Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Answer accepted by question author
  1. Deepanshu katara 18,050 Reputation points MVP Moderator
    2024-10-28T06:55:56.6566667+00:00

    Hello , Welcome to MS Q&A

    Here are a few steps you can try to troubleshoot and resolve this issue:

    1. Permissions: Ensure that the application or service principal making the API call has the necessary permissions to reset passwords. The required permission is User.ReadWrite.All.
    2. API Endpoint: Verify that you are using the correct API endpoint for resetting the password. The endpoint should be in the format --> PATCH https://graph.microsoft.com/v1.0/users/{user-id} with the appropriate payload to reset the password.
    3. Payload Format: Ensure that the payload for the password reset request is correctly formatted. It should look something like this:
       {
         "passwordProfile": {
           "password": "newPassword",
           "forceChangePasswordNextSignIn": true
         }
       }
       
    
    
    

    If you have verified all the above and are still encountering the issue, it might be helpful to check the Azure AD audit logs for any additional details or errors related to the request and you can share that with us and we can debug accrodingly

    Please let us know if any questions

    Kindly accept answer if it helps

    Thanks

    Deepanshu

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.