SharePoint – import a picture from AD for the user profile

Consider the following scenario.

 You have JPG pictures in AD, stored with the users thumbnailPhoto attribute.
 You try to import pictures for a user profile from the Active Directory thumbnailPhoto attribute,
 to store within the Picture attribute in Microsoft SharePoint Server 2010.

 You have set up an import Picture URL mapping.
 User Profile synch and mysites are configured and working fine.
 Then, you perform a full synchronization in the SharePoint server.

In this scenario, the pictures are NOT added to the user profile in the SharePoint server.
(easy test - look at your MySite and select My Profile - do you see the new picture?)


Note: You CAN use following SharePoint PowerShell cmdlet command to perform the import operation:
Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http://<YourServerName>/my
The cmdlet was introduced in this fix:  (14.0.5128.5000)

You just map the thumbnailPhoto AD attribute with the Picture property in SharePoint, then run the sync, finally run the cmdlet.

create the Mapping in SP2010 or SP2013:
 go to Central Admin->Application Management->Manage Service Applications
 select your User Profile Service Application
 select the People->Manage User Properties tab
 in the left-hand column, look down and select the Picture property.
 edit this - down the bottom is 'Add New Mapping' and via the dropdown on Attribute, select thumbnailPhoto.
 it should then look like this:
   User Profile Synch Connection
go back to the Manage User Properties and you should now see
   Picture    URL   thumbnailPhoto

OK, so now Synchronization->Start Profile Synchronization. Let that run through.
Next you will want to double-check your MySiteHostLocation.
select My Site Settings->Setup My Sites
grab the entry from My Site Host Location - that is what we need for the MySiteLocation parameter.

so, on the SharePoint box, launch a SharePoint PowerShell, (run as administrator).
the command will be as per below, with your path replacing "http://<YourServerName>/my"

Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http://<YourServerName>/my

Now, go back to your mysite, select your profile and... voila!!  the new picture has been pulled in from AD.

 Things that can go wrong:

  • Be on current Cumulative Updates. (Post Dec 2011 absolute minimum!)
  • User Profile Synch service has to be running/enabled/OK!
  •  Permissions:
    •  Service Applications->User Profile Service Application, click Permissions. 
          Add your account and check the Full Control checkbox.
    •  Service Applications->User Profile Service Application, click the Administrators
          Add your account there and check the Manage Profiles.
  • Site Collection Administrator for the My Site host
  • DBO access to the DB containing mysite host.
  • run powershell with 'Run as Administrator'


Comments (34)
  1. Anonymous says:

    Good post.thanks.

  2. Anonymous says:

    Great post! I followed these steps and I can see user's pictures in People Search as well as in their profiles.

    The only point when I got error in PowerShell was that I was logged on with the 'Setup' account. Then I logged on with Farm admin account which had DBO permission on My Sites database and User Profile databases.



  3. Worked for me too!!!

  4. Anonymous says:

    Also, just to be clear, I did this in SharePoint 2013.

  5. hayden says:

    What if we are using another custom attribute that isn't showing in my data source to be able to map it. Can I do this through PowerShell?

  6. Fiona says:

    Is there anyway to import the pictures from AD without having to have MySites setup?

  7. Fiona says:

    Is there anyway to import the pictures from AD without having to have MySites setup?

  8. René says:


    I hope you can help me with this error:
    Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation
    Update-SPProfilePhotoStore : The pipeline has been stopped.
    At line:6 char:27
    + Update-SPProfilePhotoStore < <<< -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation
    + CategoryInfo : InvalidData: (Microsoft.Offic…ofilePhotoStore:SPCmdletUserProfilePhotoStore) [Update-SPProfilePhotoStore], PipelineStoppedException
    + FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell.SPCmdletUserProfilePhotoStore

  9. René says:

    What Am I doing wrong?????

  10. Pierre Foraz says:

    Log on to the App server as the AppFabric Caching Service account and run the script. Should be ok.

  11. Betsy Ami says:

    I’d also like to know (like Fiona) if there is anyway to import the pictures from AD without having to have MySites setup? Thank you.

  12. Joe says:

    Same as Betsy and Fiona, can I import pictures from the AD without setting up MySites?

  13. Frank Ball says:

    I’ve seen several guides similar to this one, but they all indicate that I should have the “thumbnailPhoto” attribute available to select. When I scroll down to where it should be, all I see is a closed and narrow drop down that cannot be opened/selected from. I’ve tried simply typing in the attribute name in the text box that’s there and adding that mapping, but still no joy. I’m following all of the steps I’ve seen and am using the SharePoint Active Directory import. I’ve checked rights, I’ve ran the PS script, ran the sync, checked to make sure the attribute exists in AD and is being populated and I still can’t see the user pics. Can anyone point me to where I may be doing something wrong??

  14. Nick Rawlins says:

    Will this work with Office 365. We are trying to sync our AD thumbnail pictures.

  15. emo says:


    What could be the reason to not displaying my pictures in MySites or search, but when I hover the mouse over the profile-names I am able to see the picture I imported from AD, showing up in the pop-up.?

  16. Kara Mitchell says:

    Frank Ball, you want Phase 2 of

    I also had the same issue until I followed that guide.

  17. Sam Lin says:

    Hi Luke, just got a request to enable SPProfilePhotoStore, it’s helpful. Thanks!

  18. Wouter SVB says:

    I’m experiencing the same as Frank Ball. Following all the steps, but the "attribute" dropdown stays empty. I then type in thumbnailPhoto by hand, and I don’t see any pictures showing up.

    Is there *any* way to figure out if the binary value from AD is imported at all?

  19. Wouter SVB says:

    I have now pictures in my sharepoint, right from AM.

    What I had to do was to stop using Active Directory Import, and to start using SharePoint Profile Synchronization.

    I don’t know if and why this makes sense, but it did the job for me. The "attribute" dropdown was now also filled.

  20. uday says:

    I have Followed all the steps ,Ran the command successfully Still not able to see the images…..can any 1 help…?

  21. David Jenkins says:

    It worked!. I wonder now if I can reverse it and have users submit their own photos.

  22. Shruthi says:


    Profile pictures are not importing to sharepoint. I could see either cross mark or blank photo and also i could see only GUID’s in user photo list in my site host. I ran the full sync and also ran the update profile store command but still the same.

    Photos exists in sync database but not in profile database. Please help me in fixing this.

    Thanks in Advance.

  23. SP_guy says:

    will the profile sync process update a new/changed picture from ad…. or do we have to run the Update-SPProfilePhotoStore on a regular basis?

  24. Shruthi says:

    It was working fine but now its stopped getting the photo from AD and we ran the update-spprofilephotostore command.

  25. Paulo Relogio says:

    I tryed this on sharepoint 2016. but no luck.

    can anyone confirm if this works on sharepoint 2016???


  26. Firdouz Hussain says:


    I have created userprofile service and imported all photos in sharepoint.But the issue is if we create any new profile in ad it syncing in sharepoint but its not syncing picture in sharepoint userprofile.I think if we ran the powershell command to update the mysite profile store it will create duplicate items.Any idea on this.

  27. Huiwoo says:

    Hi when i syn my AD 2008 to SP2016 most user profile attributes able to populate in SP some UP dont have email show even in AD ID attribute have email indicated. And last in AD Attribute “thumbnailPhoto” show each user have photos with a hexdecimal but still never show up in SP user profile

  28. I have always set picture property mapping as export direction since self service will minimize IT work, but since we do not ask users to update their pictures, users are updating their pictures on outlook instead of SharePoint. Can i change the mapping to import direction, remove the existing export direction, full sync, and then put it back to export? Will it break anything?

  29. Ofer Gal says:

    I do all this in SP 2016 and no pictures are coming to the profile.
    I see no errors anywhere.
    I noticed SP 2013 had both “User Profile Service” and “User Profile Synchronization Service” but 2016 has only “User Profile Service”.
    Anyone can explain this?

    Is there a way to upload a batch to the profile store?

Comments are closed.

Skip to main content