Requirements:
- SharePoint Server 2010 with at least the
October Cumulative Update installed. (**UPDATE** SP2010 SP1 with at least Feb 2012 CU) - Successfully working User Profile Service Application
- Profile Photo stored in thumbnailPhoto AD attribute (I used the PowerShell script found here to import the picture into the attribute)
Steps to Perform:
- Create an import PictureURL mapping
- Perform a full profile synchronization
- Run the Update-SPProfilePhotoStore PowerShell command
Create an import PictureURL mapping
Edit the User Profile Picture property by navigating to Manage Service Applications > User Profile Service Application > Manage User Properties > Picture

Make sure your Active Directory profile connection is selected, and then choose the thumbnailPhoto attribute and Import direction

Since you’ll be controlling the profile photos from Active Directory, change Edit Settings to “Do not allow users to edit values for this property”

Click OK to make the changes
Perform a full profile synchronization
Manage Service Applications > User Profile Service Application > Start Profile Synchronization

The synchronization may take a while, so be patient.
Once completed, if you go to the profile page you’ll notice that the image wasn’t added.

Run Update-SPProfilePhotoStore PowerShell Command
Launch the SharePoint 2010 Management Shell (Start > All Programs > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell) and run the following command:
Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation
http://<YourServerName>/my

Now go back to the profile page to review the results


_____________________
Sponsors *Trusted SharePoint Ads Only!*
Packaged Enterprise Search
for SharePoint.View a quick online demo here! Surfray.com/Ontolica
Free Outlook Sidebar!
Access SharePoint from Outlook w/ harmon.ie Sidebar. Download Now!
SharePoint Migration Tools
Sharegate: No-Brainer Migration Tools for SharePoint. $375.
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.











11/19/2010 at 3:35 pm
If this property in UPS is set to export and edit by the user will it sync bad to AD if you upload a photo in a my site?
11/22/2010 at 7:16 am
Yes, it would sync back to AD then
12/09/2010 at 1:45 pm
Hi, this works but it doesnt seem to create all the 3 size that sharepoint uses needs, it only seems to create the large one. Have you any experience with this?
12/25/2010 at 12:12 pm
Finally got this to work, you must add permissions for youself in both administrator and permissions on the User Profile Service Application. Also, wanted to see if there is a way you can add a custom job so this can run every so often and update profile pictures without manual administrator interaction.
02/21/2011 at 5:46 pm
Ran a windows task everyday at 6AM to run shell commands, now our SharePoint syncs photos automatically.
02/21/2011 at 10:51 am
The Man. Shell says it does not know property CreateThumbnailsForImportedPhotos. Any idea?
02/23/2011 at 9:09 am
Hi,
I followed the steps and I can see the images with different sizes in the Profile Photo Library, but at the user profile page instead of image there is a red cross (which means image not found) can you suggest what could be the problem.
Thanks!
Kazim Raza
04/27/2011 at 9:36 am
I am also getting the same issue which Kazim is getting.
One thing I have noticed is that the url for the pic is not proper. Its missing a ‘/’. The url is
http://server/personal/mysitehostUser%20Photos/Profile%20Pictures/xyzUsername_MThumb.jpg
whereas it should be
http://server/personal/mysitehost/User%20Photos/Profile%20Pictures/xyzUsername_MThumb.jpg
05/25/2011 at 10:06 am
Interesting. Try going to the UPS and then “Setup MySites” and make sure you have a “/” after your MySite Host URL property. Just a wild guess that this may do the trick.
04/29/2011 at 7:10 am
Adam,
I followed the steps but it’s not working. I did not get any error message, and tested for 3 different users the photo on thumbnailPhoto AD attribute it’s not synced in SharePoint.
Any idea in troubleshooting this?
Thanks
05/25/2011 at 9:57 am
Adam, I’ve tried for a few days to get this to work with no success. One problem is that the command “Update-SPProfileStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http:///my” throws the error “A parameter cannot be found that matches parameter name ‘CreateThumbnailsForImportedPhotos’”. I did get the command to run successfully by using “Update-SPProfileStore -MySiteHostLocation http:///my“.
The second problem is that during the profile synch, ForeFront is throwing ma-extension-errors that the URI could not be determined. I think that this may have to do with a mismatch of picture data types. SharePoint is expecting a URL while AD is supplying an Octet string. Any ideas how to get these errors resolved?
Thanks for any help you can provide.
Ron
05/25/2011 at 10:04 am
@Ron – Is your 2010 environment patched to Oct CU or later? That includes the update to the Update-SPProfileStore command. Make sure you have the proper permissions to use PowerShell via Add-SPShellAdmin, or make sure you try the command as the SharePoint Farm Account
10/20/2011 at 4:52 am
You are the best, worked like magic. i was leaving out the •Run the Update-SPProfilePhotoStore PowerShell command
10/20/2011 at 5:11 am
Thank you Gloria for the kind words! Glad it worked out for you!
10/26/2011 at 1:29 pm
Check out codetwo active directory photos. http://www.codetwo.com It’s free and very easy to use when uploading photos to AD.
10/27/2011 at 4:10 pm
Do you have to be using mysites to be able to synchronize the pictures from AD to Sharepoint? I am able to synchronize other attributes from AD but not the picture.
11/09/2011 at 6:14 am
I can add the mapping to the “thumbnailPhoto” just fine, but when I want to save/exit the property settings page by clicking “OK” in the bottom of the page, it just hangs and eventually states (near the top): “An error occurred when updating a property.”
Any ideas, anyone?
11/10/2011 at 3:20 am
Solved that part now. Had just installed SP1 and June ’11 Cumulative Update, but had not SPUpdate’ed my databases. Still have problems though. Will start a new thread.
01/29/2012 at 9:10 am
Hi,
Thanks Guys.
We are having a FBA based site. It looks like update command works well when my sync connection is windows based and claimsuseridentifer is not mapped.
In our case we need the conn to be forms based and claims user identifier – > samAccountName.
” Error processing the photo URL User Photos/Profile
Pictures/0c37852b-34d0-418e-91c6-2ac25af4be5b_156.jpg for user i:0#.f|ad|……
: System.UriFormatException: Invalid URI: A Dos path must be rooted, for
example, ‘c:\’.”
Any help will be useful
02/13/2012 at 12:25 pm
Hi!
Great post, very useful and very clear.
We have followed your steps:
- In AD we have binary data in thumbnailPhoto attribute
- We run a full profile sync
- We executed
‘Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation
http:///mysite‘
The command is executed with no errors.
But in User Profile we don’t see any photo, library ‘http://srv/mysite/User%20Photos/Forms/AllItems.aspx’ is empty.
Please, could you tell us what we should check?
Thanks!
Regards
02/29/2012 at 5:00 am
We are having the same exact issues as @Susana. Can you possibly shed some light on it? We are storing pictures in AD using an Octet string…
03/02/2012 at 7:01 pm
Same issue like Susana and Chris
03/02/2012 at 11:02 pm
I have read that by installing the Dec 2011 CU this issue has been resolved. Apparently, one of the previous CUs after SP1 broke it. I would make sure you have installed the Dec 2011 CU. That is our new baseline version for all new installations that we recommend for clients. Of course, test this in your Test environment first.
03/03/2012 at 5:20 am
The names are displayed as corp\username in SharePoint. If I update the display name in AD it’s ok. But can this be done for all users?
03/16/2012 at 2:44 pm
Adam, thanks for this post, much better than other methods I’ve seen. One issue though, I’m getting an error in PowerShell that no other user has commented on. Any idea what the problem might be?
PS C:\Users\SP_Admin> Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http://spserver/my
Update-SPProfilePhotoStore : Object reference not set to an instance of an object.
At line:1 char:27
+ Update-SPProfilePhotoStore <<<< -CreateThumbnailsForImportedPhotos 1 -MySite
HostLocation http://spserver/my
+ CategoryInfo : InvalidData: (Microsoft.Offic…ofilePhotoStore:
SPCmdletUserProfilePhotoStore) [Update-SPProfilePhotoStore], NullReference
Exception
+ FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell.
SPCmdletUserProfilePhotoStore
I tried entering a bogus site name, http://spserver/mynonsense, and it said it couldn't find that site, so it is at least trying to access /my.
03/16/2012 at 5:14 pm
To answer my own question, it’s a permissions issue. I gave the current user full control of User Profile Service Application and then it worked.
03/26/2012 at 9:48 am
Thanx. Nice one. Didn’t work, but CU 2012 March helped (possibly it was the december actually).
04/05/2012 at 5:38 am
Yes. My updated post on TCSCBlog.com now lists the Feb 2012 CU as the pre-req. I’ll update this one soon in case people land here instead of going to the updated post.
04/05/2012 at 5:04 am
If the profile photo already exists in Sharepoint, will the AD update overwrite it with the AD images ?
ie. If someone updates their photo and I upload it to AD, will it get replicated to Sharepoint or will sharepoint ignore it as it already has a pic ?
Ian
04/05/2012 at 5:37 am
Great question. AD will overwrite the pic. Just like if you were to manually change a user’s last name. The next sycn with AD it would set that last name back.
05/04/2012 at 9:17 am
For all those who have trouble with the Links of the Pictures in SharePoint 2010 if Importet from thumbnailPhoto Atribute AD.
Try Adding the picture to AD with anoter Program.
At first i was using Exclaimer Outlook Photos to set thumbnailPhoto and after UserProfileSync an UpdatePhotoStore (btw thanks for that Information) the Link of the Picture in the MySite Profile Page was different to the location (real location had an extra /_t/)…couldent figure out how to change that.
After adding Pictures via AD Photo tool by cjwdev Photo links an location matched after syncing and Updating PhotoStore
Maybe this is helpful to somebody.
Have a nice Weekend.
05/19/2012 at 7:13 am
Need to ensure that SP1 & Cumulative updates are installed in form servers.
Create one windows tasks so that it will exectue below tasks every day:
Update-SPProfileStore -MySiteHostLocation http://mysite (One time job)
Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http://mysite (Schedule this task)