top of page
  • Nithin Janardhanan

How to Import pictures from AD to UPA – SharePoint 2010

Updated: Apr 11

  1. You should apply the October 2010 CU or a later one as appropriate

  2. Restart the User Profile Synchronization service (ie stop and start)

  3. Edit the picture property (_layouts/editproperty.aspx) in the UPA. Add a property mapping that imports the thumbNailPhoto attribute from AD.

  4. This should cause a thumbnailPhoto checkbox to show up on the “Select Attributes” page of the Active Directory MA (as viewed through the FIM client)

  5. Kick off a full profile sync from Central Admin

  6. TIP: It might help to edit the sync connection to import an OU with only a few users for verification purposes. Or maybe create a new sync connection.

  7. After sync completes, in the FIM client, find the DS_FullSync (this is what reads data from AD) run associated with the full sync that just completed. Click the Adds link, find a test user, click it…look to see if the thumbnailphoto attribute shows data.

  8. Next look for the MOSS_Export run (this is what writes data to SharePoint), similarly, look for your test user and see if pictureURL has data under the New Value column.

  9. The step above will create a picture for each user in the User Photos picture library under the mySite host…eg http://mySiteHostURL/User%20Photos/Forms/AllItems.aspx. The unprocessed pics will be named with GUIDs.

  10. If you don’t see the pics that you expect…then there might be a problem with the format of the data stored in AD. Look in the ULS logs for exceptions. One exception I ran into was…this was because the thumbNailPhoto attribute contained base64 data and we can’t use that:

  11. SavePictureToLibrary: Error processing the photo URL 0c37852b-34d0-418e-91c6-2ac25af4be5b_3.jpg for user 3: System.ARgumentException: Parameter is not valid.

  12. at System.Drawing.Bitmap..ctor(Stream stream, Boolean user|cm)

  13. at Microsoft.Office.Server.UserProfiles.UserProfileGlobal.SaveImportedPictureToLibrary(UserProfileManager userProfileManager, Int64 recordId, Byte[] binaryPicture)

  14. To verify the data format, download AD Photo Edit from…and use it to import a picture for a user. This tool stores data in the right format. You’ll need to start from step 5 again.

  15. If a picture with a GUID is present in the UserPhotos folder….then you’re ready to run:

  16. Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 –MySiteHostLocation <mySiteHostURL>

  17. This will update the pictureURL column in the userprofile_full table (user profile db) in SQL for your test user as well as generate 3 additional pics in the user photos folder.

1 view0 comments

Recent Posts

See All
bottom of page