0

I have created a SharePoint Framework web part using React. After that, I integrated @pnp/graph under that SPFx application. Also, I have given an API access permission request to my SPFx app.

I have fetched all users from the Azure AD group. Now, I need to update the currently logged-in user property under Azure AD. Below is my code snippet,

import { graph } from "@pnp/graph";

 public async UpdateCurrentUserProperties(companyName) {
    return await graph.me.update({
        companyName: companyName
    });
}

Below is the reference link, https://pnp.github.io/pnpjs/graph/users/#update-current-user

I am facing the below error while updating the currently logged-in user profile properties under Azure AD.

Unable to update the specified properties for on-premises mastered Directory Sync objects or objects currently undergoing migration

Can anyone help me with the same?

1 Answer 1

0

The error "Unable to update the specified properties for on-premises mastered Directory Sync objects or objects currently undergoing migration" usually occurs if you are trying to update the users which synced from on-premises to Azure AD.

  • You have to update these users on on-premises environment and then sync it to Azure.
  • To resolve the error, Try changing it on On-prem server and then sync it to Azure AD.
  • Please check if your organization uses a hybrid environment and those users are synced from AD, you have to manage them from on-premises Exchange.
  • Check whether you have given required API permissions.
  • You can refer this similar case that can give you some pointer.

For more in detail, please find below links:

azure - Set-AzureADuser failing - Stack Overflow

Unable to update the specified properties for on-premises mastered Directory Sync objects - Microsoft Q&A

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.