Is there any way to update any user's profile properties using CSOM? I'm trying to update the user's profile picture. I'm able to update the current logged in user's profile picture using the following code snippet:
ClientContext context = new ClientContext("https://<sharepoint site url>");
context.Credentials = new SharePointOnlineCredentials("[email protected]", <password as securestring>");
PeopleManager peopleManager = new PeopleManager(context);
Stream fileStream = new FileStream(@"<image file path>", FileMode.Open);
peopleManager.SetMyProfilePicture(fileStream);
context.Load(userProperties);
context.ExecuteQuery();
But how do I update another user if I know the username? Provided I have admin rights on the User Profile Service Application.