Hi @Julien St-Pierre Fortin ,
Please refer to following code to get PersonProperties
string serverUrl = "http://serverName/";
string targetUser = "domainName\\\\userName";
// Connect to the client context.
ClientContext clientContext = new ClientContext(serverUrl);
// Get the PeopleManager object and then get the target user's properties.
PeopleManager peopleManager = new PeopleManager(clientContext);
PersonProperties personProperties = peopleManager.GetPropertiesFor(targetUser);
clientContext.Load(personProperties, p => p.AccountName, p => p.UserProfileProperties);
clientContext.ExecuteQuery();
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hi @Julien St-Pierre Fortin ,
Would you tell me whether your issue has been resolved or have any update?
I am looking forward to your reply.
Have a nice day!
Thanks,
Raytheon Xie
Hi Raytheon,
I work with Julien, so I can answer.
The issue is intermittent. We have multiple clients with the same issue, but it's not happening every time.
We could be making calls for hours and not have any issue, but then one call will fail that way.
It doesn't seem to be tied to a particular user.
If you want to reproduce it, you'd need to write a script that runs the code for all users in batches of 100 users, and run it for a couple hours in a loop.
The solution we'll be trying is adding retries for the call and see if it helps.
It really seems like a new version of Sharepoint Online broke something somewhere, since we're seeing an increased error rate with no code change on our part.
I hope you're able to reproduce the bug with my instructions.
Thanks for your work!