question

LaxmiPrasanna-3771 avatar image
0 Votes"
LaxmiPrasanna-3771 asked ·

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

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?

azure-active-directory
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

very good good job

0 Votes 0 · ·
amanpreetsingh-msft avatar image
1 Vote"
amanpreetsingh-msft answered ·

@LaxmiPrasanna-3771 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.

· 3 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@amanpreetsingh-msft I tried to use "forceChangePasswordNextSignIn" but still while signing in it is prompting me to change the password. According to the documentation it says while using that attribute it changes the password and does not prompt to change password after signing in right. If we are not using this attribute also it is prompting to change password after signing in. Can you please correct me if I am wrong. Is there any other attribute where we can set the password forcefully and do not prompt the user to change password again after signing in?

0 Votes 0 · ·

@LaxmiPrasanna-3771 Did you set "forceChangePasswordNextSignIn": false? I tested it and didn't get any prompt to change password after that.

0 Votes 0 · ·

Ya it worked, my apologies there was some confusion. Thank you it was helpful.

0 Votes 0 · ·
soumi-MSFT avatar image
1 Vote"
soumi-MSFT answered ·

@LaxmiPrasanna-3771, 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 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@soumi-MSFT , we are trying to use microsoft graph api, https://graph.microsoft.com/ these http calls. So do we have forceChangePasswordNextLogin in that api? According to this documention https://docs.microsoft.com/en-us/graph/api/resources/passwordprofile?view=graph-rest-1.0 it says we have this property enabled in the microsoft graph apis.

0 Votes 0 · ·