Forum Discussion
BrynnerFlores
Feb 21, 2024Copper Contributor
How to reset a user's password using the Microsoft Graph API in C#?
I am trying to reset a user's Office 365 account password using the Microsoft Graph API with C#, the permissions I have assigned are as follows: This is an attempt I made in PowerShell: ...
VasilMichev
Feb 21, 2024MVP
How are you authenticating? PowerShell uses its own application registration for authentication, and therein you have likely already consented to the required permissions. You need to do the same for the application you are using in your custom code.
BrynnerFlores
Feb 21, 2024Copper Contributor
- VasilMichevFeb 21, 2024MVPSo make sure the application you're leveraging for the client credentials flow has the necessary permissions. You can decode the token via jwt.ms and similar tools and confirm the presence of User.ReadWrite.All. Also, if the target user holds any admin roles, the service principal will need to have the Privileged auth admin role assigned.