1

I got a request to create an App in a on-premise SharePoint 2013 enviroment. The App should upload a userprofile picture to a list and then send the small-thumbnail (sharepoint created) to the Active directory and update the user picture there (pref with REST).

Is this possible and any tips on how i can get this done?

1

Assuming user is a DirectoryEntry instance containing a reference to a user object in AD, and imageContent is a byte array that contains the image, you can update the picture in AD like:

user.Properties["thumbnailPhoto"].Clear();
user.Properties["thumbnailPhoto"].Add(imageContent);
user.CommitChanges();

However, as far as I kow, there is no REST interface to AD in on-premise, so you should create a wrapper service if you need such interface. An alternative solution is to create a "classical" SharePoint solution instead of an app, like a web part (see similar solution here).

0

The UserProfile service does this for you. You can have that configured to update the AD profile picture from SharePoint user profile. If you wanted to maintain the list approach for whatever reason you can copy the picture to your list as well as user profiles. although you can't access AD directly you can make this type of change via the profile service with CSOM.

  • Thank you for your answer, any recomendation on where i can find how to configure the UserProfile Service to do this? – Jenkaa Mar 9 '15 at 14:09
  • There are plenty of resources. I recommend you review the TechNet. articles first: social.technet.microsoft.com/Search/… – Jesus Shelby Mar 16 '15 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.