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.

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

I have the same issue. All of the s (Small) images are apearing where they should, but none of the m (medium) images work. I get the red X too. How do I check the Profile Photo Library? Did you ever get it working?

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?

@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

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.”

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:\’.”

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 -MySiteHostLocationhttp:///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.

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.

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 ?

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.

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)

When I run the first part, Update-SPProfileStore -MySiteHostLocation http://my_server/my, I get an error that …
The term ‘Update-SPProfileStore’ is not recognized as the name of a cmdlet, fun
ction, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.
At line:1 char:22
+ Update-SPProfileStore <<< Update-SPProfilePhotoStore -CreateThumbnailsFo
rImportedPhotos 1 -MySiteHostLocation http://my_server/my

Dec 11 I believe.
Feb 12 doesn;t seem to like installing on the server, from what i’m being told.
April 12 is out but can;t find the actual software yet and Microsoft aren;t replying to my download request !

Hi, what I’m seeing is that the userprofilephoto is stored in the User Photo library with a name like: 0c37852b-34d0-418e-91c6-2ac25af4be5b_5 but it’s will not automatically create the necessary thumbs. With the PS command it does. (I’m on the latest CU)

Make sure that the account you are using PowerShell with has ShellAdmin rights. If you are getting that error that typically means you don’t. Login with your SharePoint Farm account and use the Add-SPShellAdmin command to grant your account the proper permissions to the database(s). http://technet.microsoft.com/en-us/library/ff607596.aspx

Has anybody else run across anything on this that you know of? I’m still getting the error the Object reference not set to an instance of an object. I’ve tried several permission type things, but still getting Access denied according to the logs. I can always open a support ticket, but was just curious. Thanks.

thank you for rapid reply! I have done already it worked, the matter was in SPShell Admin rights,when I had log in OS by fram admin , which is the SPShellAdmin , ran PowerShell under my SPShellAdmin , it worked! anyway thank you for this great job , I really appreciat it!

Hi Adam, first off this was a great bit of info that is missing from general SharePoint documentation everywhere I researched. I set this up and it worked great. A bit later I started noticing that updated photo’s were not showing up (the old photo was still displaying). After a bit of troubleshooting I found that I needed to run a full profile import and then re-run the powershell script in order to get the updated photo’s to show. Just thought I would throw that out there in case anyone else ran into the same issue.

Hi, I have a problem with thjs powershell cmd Update-SPProfileStore.
Error return
The term ‘Update-SPProfileStore’ is not recognized as the name of a cmdlet, fun
ction, script file, or operable program. Check the spelling of the name, or if
a path was included, verify that the path is correct and try again.

SharePoint version is 14.0.6123.5000.
I can’t find any information about Update-SPProfileStore on MS technet.

My original problem is, when i use Update-SPProfilePhotoStore -MySiteHostLocation, SharePoint generate PictureUrl with AAM default of mysite. And my users use AAM intranet. So, they have a red cross …

If I use Update-SPProfilePhotoStore -MySiteHostLocation “AAM default” or Update-SPProfilePhotoStore -MySiteHostLocation “AAM MySite” same result.

Nice Post ! However, have a query.. If I do not have MySite setup done.. then is it possible to get the user pictures from AD ? In my case , I just want to have an people search to be configured where want to show the picture of the user along with the details.