Import User Profile Photos from Active Directory into SharePoint 2010


SharePoint 2010


  • 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

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!

Free Outlook Sidebar!
Access SharePoint from Outlook w/ Sidebar. Download Now!

SharePoint Migration Tools
Sharegate: No-Brainer Migration Tools for SharePoint. $375.

SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.


Subscribe to our RSS feed and social profiles to receive updates.

89 Comments on “Import User Profile Photos from Active Directory into SharePoint 2010”

  1. Chris Poteet Says:

    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?


  2. Greg Says:

    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?


  3. Tyler King Says:

    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.


    • Tyler King Says:

      Ran a windows task everyday at 6AM to run shell commands, now our SharePoint syncs photos automatically.


  4. Samer Shennar Says:

    The Man. Shell says it does not know property CreateThumbnailsForImportedPhotos. Any idea?


  5. Kazim Raza Says:

    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.
    Kazim Raza


  6. Fernando Possebon Says:


    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?



  7. Ron Says:

    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.


    • sptwentyten Says:

      @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


  8. Gloria Says:

    You are the best, worked like magic. i was leaving out the •Run the Update-SPProfilePhotoStore PowerShell command


  9. Carpadum Says:

    Check out codetwo active directory photos. It’s free and very easy to use when uploading photos to AD.


  10. Teddi Says:

    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. J.Jespersen Says:

    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?


    • J.Jespersen Says:

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


  12. Paul SlagerPaul Says:

    I can’t get that stupid powershell command to work I have upgraded to the latest service patch. I have been trying different things for hours now any help would be appreciated.

    Here is the error message I get back. Looks like it doesn’t like -CreateThumbnailsForIportedPhotos

    PS C:\Users\pslager> Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http://mysites
    Update-SPProfilePhotoStore : Object reference not set to an instance of an object.
    At line:1 char:27
    + Update-SPProfilePhotoStore <<<< -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation http://mysites
    + CategoryInfo : InvalidData: (Microsoft.Offic…ofilePhotoStore:SPCmdletUserProfilePhotoStore) [Update-SPProfilePhotoStore], NullRefer
    + FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell.SPCmdletUserProfilePhotoStore


  13. vijaykishan Says:


    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


  14. Susana Says:


    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
    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?




  15. Chris Pettigrew Says:

    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…


  16. Peter Deleu Says:

    Same issue like Susana and Chris


    • Adam Preston Says:

      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.


  17. Peter Deleu Says:

    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?


  18. Aaron Says:

    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
    + FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell.

    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.


    • Aaron Says:

      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.


  19. Jake Says:

    Thanx. Nice one. Didn’t work, but CU 2012 March helped (possibly it was the december actually).


    • Adam Preston Says:

      Yes. My updated post on 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.


  20. Ian O Says:

    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 ?



    • Adam Preston Says:

      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.


  21. Torsten Says:

    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.


  22. Naga Venkateswarlu Says:

    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)


    • Ian O Says:

      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

      I get…
      Update-SPProfilePhotoStore : Object reference not set to an instance of an obje
      At line:1 char:27
      + Update-SPProfilePhotoStore <<<< -CreateThumbnailsForImportedPhotos 1 -MySite
      HostLocation http://my_server/my
      + CategoryInfo : InvalidData: (Microsoft.Offic…ofilePhotoStore:
      SPCmdletUserProfilePhotoStore) [Update-SPProfilePhotoStore], NullReference
      + FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell.

      I have granted Administrator full access to the User Profil Service, as suggested by Aaron, restarted the server but still the same.
      Could it be the CU version on the server stopping this ?

      Ian O


      • Adam Preston Says:

        It very well could be the CU, what month and year CU are you at?

      • Ian O Says:

        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 !

      • Adam Preston Says:

        You will need Feb 2012 at least….April 2012 CU was just recently pulled by MS and has not been re-released yet.

  23. Amancio Says:

    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)

    Kind regards, Amancio


  24. Chad Says:

    Works perfect! Don’t know why this isn’t a widely documented solution. Thanks Adam.


  25. Shabih Says:

    I followed the steps worked perfectly on mysite. But the profile pictures are not shown when i am searching the people in people search.


  26. Dave Says:

    I know nothing about Sharepoint so forgive me, but I too get the Object reference not set to an instance of an object. I have no idea where I would add myself full control permissions.


    • Adam Preston Says:

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


      • Dave Says:

        I am actually a Farm Administrator, but I did login as the user account that is setup for that and did the add-spshelladmin and still get the error.

      • Adam Preston Says:

        When you start the SharePoint 2010 Management Shell (PowerShell) do you see any sort of message at the top that reads something like “cannot access the local farm”?

      • Dave Says:

        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.

  27. Dave Says:

    I don’t, but I’m thinking I need to make sure the CU is installed from February. An outside vendor installed SP just recently and I don’t see any CU in the installed updates list, just SP1.


  28. ScottB Says:

    Works great, thanks for taking the time to write it down. However, when I run a full index, they all go away until I run the power shell command again. Is there a way to make that sticky?


  29. Dave Says:

    I came across this article and ran it as an account that already had these permissions. Worked like a charm:


  30. Sali Says:

    I can’t understand why this happening, pleas help me what should i do for shoot this trouble !!

    Update-SPProfilePhotoStore : Cannot convert ‘System.String’ to the type ‘System
    .Boolean’ required by parameter ‘CreateThumbnailsForImportedPhotos’.
    At line:1 char:61
    + Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhoto <<<< 1-MysiteHo
    stLocation http://portal/my/personal
    + CategoryInfo : InvalidArgument: (:) [Update-SPProfilePhotoStore
    ], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.Office.Server.Us


    • Adam Preston Says:

      Try it without the “1” after the parameter. I heard where several state you just need the parameter name and not the “1” after it.


      • Sali Says:

        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!

  31. neil Says:

    PS C:\Users\SP_Admin> Update-SPProfilePhotoStore -CreateThumbnailsForImportedPho
    tos 1 -MySiteHostLocation http://fedssharep:2001
    Update-SPProfilePhotoStore : Object reference not set to an instance of an obje
    At line:1 char:27
    + Update-SPProfilePhotoStore <<<< -CreateThumbnailsForImportedPhotos 1 -MySite
    HostLocation http://fedssharep:2001
    + CategoryInfo : InvalidData: (Microsoft.Offic…ofilePhotoStore:
    SPCmdletUserProfilePhotoStore) [Update-SPProfilePhotoStore], NullReference
    + FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell.


  32. Tim Says:

    Thanks for the information.

    I’ve finally managed to set it all up, and have a folder full of user images.


    The Images are named : domain_username_LThumb.jpg
    and sharepoint seems to be looking for : company_username_LThumb.jpg

    What defines the naming convention ?




    • Umesh Mishra Says:


      Can you please share what worked for you .please mention the steps..thanks


      • Tim Says:

        I just followed the instructions above.
        There were a couple of issues with which username I used for the connector, but eventually used my Sharepoint_Admin for everything and it seemed to help.

        I’ve got a folder full of images, but still not got the file names correct.

  33. James Hendrix Says:

    Have been fighting this issue for too long. I followed the steps and all worked for me.


  34. Bryan Says:


    Anyone had any troubles with SharePoint 2013 User profiles?

    Looks like the powershell is not working and this the error

    Update-SPProfilePhotoStore :
    UserProfileApplicationNotAvailableException_Logging ::
    UserProfileApplicationProxy.ApplicationProperties ProfilePropertyCache does
    not have d6514f8d-305e-41eb-ac86-530ee36009a4
    At line:1 char:1
    + Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1
    -MySiteHostLocat …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidData: (Microsoft.Offic…ofilePhotoStore:
    SPCmdletUserProfilePhotoStore) [Update-SPProfilePhotoStore], UserProfileAp
    + FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell.

    Any ideas?


  35. Sid (Vishus) Daoud Says:

    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.


  36. Yoann Says:

    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.

    Any ideas ?


  37. Krutika Says:

    Hi Adam,

    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.



  38. Sali Says:

    hase anybody get the same proccess for sharepoint 2013 , i didn’t get the picture from the AD , please if someone done it share the right methode for SP 2013, will be appriciate !


  39. Nicolas Says:

    Great article, thks!


  40. SPGeek Says:

    Thanks! Found this another great step by step guide to Import User Pictures from Active Directory to SharePoint 2010 My Site:


  41. Vivek Says:

    Hey adam,

    Everything worked fine except, the photo shows up a red X and when I try to access the location from red X. I get a 404.

    Can you please help or hint with what the problem most likely could be



  42. http://clashofclanshackzip.blogspot.Com/ Says:

    Thanks for finally talking about >Import User Profile Photos from Active Directory into SharePoint 2010 | SharePoint Adam <Liked it!



  1. Import User Profile Photos from Active Directory into SharePoint … | Active Directory Password - 11/19/2010

    […] Manage Active Directory – Google Blog Search by Fergal OP […]

  2. Bookmarks for October 27th through December 9th | Savage Nomads - 12/09/2010

    […] Import User Profile Photos from Active Directory into SharePoint 2010 – […]

  3. Import profile pictures from an external application - Doron Goldberg - 10/03/2011

    […] and can be easily solved in various ways. One of them is described here (Hebrew) using FIM or here (English) using simple […]

  4. Problem Import Pictures into User Profiles from Active Directory | Code Äffle Blog - 10/29/2011

    […]… […]

  5. Getting Active Directory thumbnail photos in to SharePoint 2010′s User Profile Service | - 11/09/2012

    […]… […]

  6. SharePoint 2010 User Profile Photo not updating - Balestra - Balestra - 01/03/2013

    […] Luckily, a quick search on the internet got me to this post from Adam Preston. […]

  7. Options for SharePoint User Profile Properties and Photos - Brian the PFE - Site Home - MSDN Blogs - 03/18/2014

    […]; […]

  8. Options for SharePoint User Profile Properties and Photos | ITGrinder - 03/18/2014

    […]; […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: