30 thoughts on “Import User Photos From Active Directory Into SharePoint 2013

  1. Joeprakash

    I am not getting any value in the Source data connection drop-down.
    What is the procedure to populate values in that drop-down?

    Reply
    1. richardstk Post author

      The source data connection drop-down includes your Active Directory import source, i.e. you need to have already configured a user import from Active Directory. This is done from Manage Profile Service -> Configure Synchronization Connections.

      Reply
  2. Brian Hastings

    I’ve tried this and I have two issues. One I cannot select thumbnailphoto from the dropdown as it is empty. I’ve tried entering manually instead. Then when I come to run the PowerShell script I get a nasty red error with invaliddata in it. I am assuming these 2 issues are linked?

    Reply
    1. richardstk Post author

      The thumbnailPhoto attribute is an attribute of a user’s account within Active Directory. Have you configured a user import source of type Active Directory (Manage Profile Service -> Configure Synchronization Connections)?

      When mapping the SharePoint user attribute of picture to the AD attribute ensure you select the correct source from the drop down, which is your AD user import source.

      The other thing to check is that the thumnailPhoto attribute isn’t already mapped to another SharePoint user property as the attribute drop-down only shows attributes that aren’t already mapped. Check existing mappings from Manage Profile Service -> Manage User Properties.

      Reply
      1. Brian Hastings

        Thanks for your reply. Yes my user import is configured and it’s bringing across all my users. But when I go to the Edit User Profile Property screen the I can see my source connection in the drop down but the attribute dropdown is completely empty, in fact is greyed out and narrow. I am doing an AD import rather than a full user profile sync, would this make any difference?

        richardstk commented: “The thumbnailPhoto attribute is an attribute of a user’s account within Active Directory. Have you configured a user import source of type Active Directory (Manage Profile Service -> Configure Synchronization Connections)? When mapping the SharePoi”

      2. richardstk Post author

        The AD import is almost definately the cause of the problem. These instructions are for SharePoint Profile Synchronization (as existed in 2010), rather than the new to 2013 SharePoint Active Directory Import.

  3. Patrick

    When I run the powershell command I get the following-
    PS C:\Users\XXXXXXXXX> Update-SPProfilePhotoStore -CreateThumbnailsForImportedPh
    otos $true -MySiteHostLocation http://xxxxxxxxxx
    Update-SPProfilePhotoStore :
    UserProfileApplicationNotAvailableException_Logging ::
    UserProfileApplicationProxy.ApplicationProperties ProfilePropertyCache does
    not have 525afc2b-cc75-4baa-89c7-4b3db1b185f2
    At line:1 char:1
    + Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos $true
    -MySiteHostL …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~
    + CategoryInfo : InvalidData: (Microsoft.Offic…ofilePhotoStore:
    SPCmdletUserProfilePhotoStore) [Update-SPProfilePhotoStore], UserProfileAp
    plicationNotAvailableException
    + FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell.
    SPCmdletUserProfilePhotoStore

    Reply
    1. richardstk Post author

      Check that the service account running the Distributed Cache has full control of the User Profile Service Application.

      The Distributed Cache runs as the AppFabric Caching Service, so check the “log on as” account in Services.msc. Then, grant that account Full Control by going to Central Administration -> Managed Service Applications. Highlight the User Profile Service Application and click on Permissions in the ribbon.

      Reply
      1. Patrick

        Thanks. I am running the DC under my farm account and it already has full control. I did a little more digging and found a post suggesting that I log into the server with the credentials running the DC. I did that and it appears to be happy. Gonna let it run over night to see if I have pics or not =)

      2. Patrick

        Progess! Some photos made it live, but the overall task failed with a rather cryptic error-
        Update-SPProfilePhotoStore : Cannot remove file
        “0c37852b-34d0-418e-91c6-2ac25af4be5b_19735.jpg”. Error Code: 6404.
        At line:1 char:1
        + Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1
        -MySiteHostLocat …
        + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        ~~~
        + CategoryInfo : InvalidData: (Microsoft.Offic…ofilePhotoStore:
        SPCmdletUserProfilePhotoStore) [Update-SPProfilePhotoStore], SPException
        + FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell.
        SPCmdletUserProfilePhotoStore

        Any idea where I can find this photo to manually remove it? Also Once this is completed, will new photos from AD automaticly be sync’d over, or will this process need to be repeated on a periodic basis?

      3. richardstk Post author

        Great to hear you’ve made some progress! I’m not sure how to remove the jpg file, but the guid in the filename may be a user’s guid. When I view a user profile in the User Profile Service application, the URL is http://%SERVER%/_layouts/15/ProfAdminEdit.aspx?guid=c91cfb14-f580-4aef-a2ef-35a1f9c72385&q=%SEARCHTERM%&ConsoleView=Active&ProfileType=User&ApplicationID=94d5f79c%2D3647%2D4a76%2D9389%2Dfe39c3fb3314. Maybe you can manipulate the URL in your environment to see if the guid corresponds to a user account, which might help you make progress. You could also take a look in the ULS log to see if that contains any more information.

        In my environment I have to re-run the “Update-SPProfileStore -CreateThumbnailsFromImportedPhotos …” PowerShell command to update the images. You could set this up as a Windows scheduled task.

      4. Patrick

        On the off chance the access denied was just routine file locking I re-ran the command over the weekend and it completed successfully. Thanks for the help Richard. Looks like one more thing to add to my maintenance script.

  4. Bob Cummings

    Richard
    Thanks to your blog, I’ve managed to get the staff photos import working with Sharepoint 2013 for the first time since I set up my farm! The key to this was the fact that the thumbnailPhoto field can only be mapped by using the old method of importing – not using the Active Directory one. This is the first time I have heard this mentioned and makes you wonder what the point of it is!

    Thanks
    Bob

    Reply
  5. Kyrre

    Hi, I’m trying to accomplish this with on-site Sharepoint 2013. I have done all the steps and the “Update-SPProfilePhotoStore” completes quickly with no errors. Still, no picture is showing in My Site. However, when I hover the mouse over a users name in a link etc, the picture from AD shows up.

    Any idea?

    Reply
    1. Pieter Veenstra

      Hi Kyrre, I had the same problem and When I checked my ULS logs I got errors complaining about Distributed Cache.

      Unexpected Exception in SPDistributedCachePointerWrapper::InitializeDataCacheFactory for usage ‘DistributedLogonTokenCache’ – Exception ‘Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode:SubStatus:There is a temporary failure. Please retry later. (One or more specified cache servers are unavailable, which could be caused by busy network or servers. For on-premises cache clusters, also verify the following conditions. Ensure that security permission has been granted for this client account, and check that the AppFabric Caching Service is allowed through the firewall on all cache hosts. Also the MaxBufferSize on the server must be greater than or equal to the serialized object size sent from the client.

      You might want to check your token service and the distributed cache service.

      Reply
  6. Pingback: SharePoint 2013 – Edit User Profile Property – Mapping Attribute dropdown empty | Question and Answer

  7. Darrem

    How about removing photos? I have a user where the his thumbnailphoto attribute on his account has been removed, but the profile sync is not removing it from SharePoint 2013. Any idea how to get this to work?

    Reply
  8. Pingback: SharePoint 2013 – Creating a Staff Directory in 7 Steps | SharePoint, CRM, Project Server, Office 365

  9. Aryan Nava

    This is the only steps you need to know to “Import User Photos From Active Directory Into SharePoint 2013” I went through all the steps in this blog and everything worked perfectly.

    Reply
  10. Aryan Nava

    Reblogged this on and commented:
    This is the only steps you need to know to “Import User Photos From Active Directory Into SharePoint 2013” I went through all the steps in this blog and everything worked perfectly.

    Reply
  11. Adrian Morris-Young

    Hi Richard, if users already have uploaded their picture to SharePoint the AD sync, will the AD picture over write the SharePoint one? Will this then show no picture if one is not present in AD but is in SharePoint pre sync? Can users override AD sync with a different picture or is this a one way sync?

    Reply
  12. haka

    thank you for this useful article,
    but i have a weird problem, in the my site the users have wrong profile picture ….
    do you have any suggestion?

    Reply
  13. Tom

    Let’s say you did all this and it’s working. Then one user has their picture updated in AD. Just to get that change to come through, will incremental sync do it? Can you just run the Update-SPProfilePhotoStore command only? Or do you always need to do a Full Sync first? Seems crazy to need to do a Full Sync just for one picture.

    Reply
  14. Judy

    When new photos added to AD should I do full sync or will the incremental sync update the new photos. Enlighten me please!

    Reply
  15. Firdouz Hussain

    In our AD new photos are added and i did full sync still the pictures are not showing up in userprofile. Any idea on this.

    Reply
  16. Pingback: Sharepoint User Not In Active Directory | Machoupichou

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s