0
votes

I am unable to update the birthday and hireDate properties for users in my directory.

The following request returns a 500 Internal Server Error

PATCH https://graph.microsoft.com/beta/users/[removed] HTTP/1.1 SdkVersion: Graph-dotnet-1.10.0 Authorization: Bearer [removed] Cache-Control: no-store, no-cache Content-Type: application/json; charset=utf-8 Host: graph.microsoft.com

{"hireDate":"1989-10-02T04:00:00Z"}

HTTP Response

HTTP/1.1 500 Internal Server Error Content-Type: application/json ...

Microsoft.Office.Server.Directory.DirectoryObjectUnauthorizedAccessException. Attempted to perform an unauthorized operation.

Azure AD App Permissions

1

1 Answers

0
votes

According to your description, I assume you want update user's birthday or hireDate through the Graph API.

From the returned response, your permission was denied to update the user's profile.

We should add the following permission: 'Directory.ReadWrite.All'.

To do that, we should add the Directory.ReadWrite.All scope in your code when we request an accesstoken.