Recently I came across a requirement in one of the SharePoint 2013 on premise portal implementation. All the user’s picture is updated in active directory, the question was can we import this picture uploaded to active directory to the Picture property in user profile. The answer is yes and in this post I am explaining the steps for doing it so.
So first thing I wanted to do in my development environment to update the photo in the active directory. It can be done by PowerShell script, but I found a nice that can do this task and thankfully there is a free version available. You can find the tool from the below link.
I downloaded the tool and installed on my development environment. Uploading profile picture with the tool is easy and straight forward, just select the user account and then select an image.
For the purpose of this post, I uploaded a sample picture for the account “SPSetup”. The below is a screenshot of the tool
The photo will be uploaded to thumbnailPhoto property in the active directory. You can view the properties using the ADSI Editor.
From the ADSI editor, you can see the thumbnail photo is updated.
Now I need to import this to the Picture property in SharePoint 2013 user profile. The remaining part of this post details the steps needed to import the thumbnailPhoto from active directory to the Picture property in User profile. From central administration, go to manage service applications, select the user profile service application.
Select Manage user properties link so that you will get all user profile properties available. In the user profile properties, locate the Picture property as shown below.
Click on the right arrow next to the Picture property and select Edit
In the User profile property edit page, scroll down to the bottom of the page, you will see the property mapping for the selected property. Since we do not added a mapping yet for the picture property, let us add a mapping now. You need to select a connection (You can create Connections under the Synchronization connections under your user profile service application). Then as we described earlier, the photo is uploaded to thumbnailPhoto property in the active directory, make sure the direction is selected as import. Click Add button once you are done.
Once added, you will see the mapping under the Property Mapping section.
Click OK to go to the user profile service application. Now run profile synchronization so that the property will be imported.
In the synchronization page, you can select the type of synchronization you want, whether it is incremental or full and click OK
Now in the User Profile service application page, you will see the status of the synchronization in the right side block.
Now once the profile synchronization is done, check whether the user profile photo is updated? The easiest way to do that to check the user’s personal site and see whether the personal site is updated with the picture. To my surprise, I found the picture is not updated. You can see the default picture appears for the SPSetup user even though I have updated it through the tool.
This is a known issue and there is a KB article release by Microsoft that represents this issue. (Though it was for SharePoint 2010, I think the picture URL issue applies to SharePoint 2013) This issue may get fixed in some cumulative updates of SharePoint 2013, so it worth checking whether the photo is updated before applying the fix.
As the KB article states run the following command in the powershell.
Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation <url to my site host>
See the screenshot of the PowerShell command executed (http://sp2013:11700 is the MySite host).
Now check the personal site and you will see the picture is updated.
If you have user pictures already updated in active directory as part of your company policy, you can easily import those to SharePoint.