Not able to use the property "forceChangePasswordNextLogin" while resetting AD user profile password

Laxmi Prasanna 96 Reputation points
2020-02-12T10:43:25.703+00:00

We are trying to call the update user microsoft graph api and when we are trying to use the parameter "forceChangePasswordNextLogin" we are getting an error “The property ‘forceChangePasswordNextLogin’ does not exist on type ‘Microsoft.DirectoryServices.PasswordProfile’. Make sure to only use property names that are defined by the type.“. Can we get some information whether we can use this password or not. Is there any other way to change the password forcefully?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,389 questions
{count} votes

Accepted answer
  1. AmanpreetSingh-MSFT 56,301 Reputation points
    2020-02-18T07:39:28.607+00:00

    @Laxmi Prasanna In Microsoft Graph API, it is forceChangePasswordNextSignIn not forceChangePasswordNextLogin. Below is the call that you need to use for this purpose:

    PATCH https://graph.microsoft.com/beta/users/USERNAME@YOURTENANT.onmicrosoft.com

    Body:
    {
    "passwordProfile": {
    "password": "Passw0rd33333",
    "forceChangePasswordNextSignIn": true
    }
    }

    -----------------------------------------------------------------------------------------------------------

    Please "Accept as answer" wherever the information provided helps you to help others in the community.

    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. soumi-MSFT 11,716 Reputation points Microsoft Employee
    2020-02-12T11:16:10.19+00:00

    @Laxmi Prasanna , First of all I would like to know, are you trying to make a Graph call to Azure AD tenant or Azure AD B2C tenant to update the password?
    As if you are making a graph call to Azure AD then the attribute "forceChangePasswordNextLogin" is not present there. If you are using Azure AD B2C, then to change user password by using Azure AD Graph API, first you should be a global administrator in your tenant, and then you could use

    PATCH https://graph.windows.net/myorganization/users/{user_id}?api-version

    and then update.
    {
    "passwordProfile": {
    "password": "value",
    "forceChangePasswordNextLogin": false
    }
    }

    Hope this helps.

    ---------------------------------------------------------------------------------------------------------------------------------------

    Please take a moment to "Mark as Answer" and/or "Vote as Helpful" wherever applicable. Thanks!

    1 person found this answer helpful.