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 https://<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 "https://<YourServerName>/my"

Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation https://<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'