Thursday, September 13, 2018

ShaREPoint 2013 : Profile photo not showing in mysites and search results

Many times when we rebuilt the User Profile service or Restart the User profile service, We loose the functionality of showing the user profile photo in search results or in mysites.

Errors:




Few things need to be checked here:

  • Metadata Property 
    1. Make sure Metadata Property Mappings for the PictureURL property in Search Service Application is default to "ows_PictureURL(Text), People:PictureURL(Text)".
    2. if not then add it and run the Search full crawl.
  • Import Photos or update Thumbnails in Photo Store (mostly comes after upgrade)

    Run the Update-SPProfilePhotoStore cmdlet to ensure that the SharePoint profile photo store is compatible with SharePoint Server. whenever this cmdlet used, three thumbnail versions with predictable sizes and names are created from the original photo, the new photos are placed into the My Site Host's User Photos library, and the property value in the profile database is updated

    Update-SPProfilePhotoStore -MySiteHostLocation

    OR

    Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation

    This will resolve your first issue of phot being not displayed in mysites.
  • Enabled Cross-Domain feature

    The Search result page uses "proxy" page userphoto.aspx to load pictures which takes a couple of parameters; URL of the picture, the account name (or e-mail) as well as the picture size (S, M or L). This page will return a JPEG stream of the user profile picture on the client side.

    SharePoint team has added a new feature to SharePoint that allows us to show profile pictures cross-domain in search results. This option is by default disabled , you need to do is to set the CrossDomainPhotosEnabled property on the SPWebApplication object to true.

    1
    2
    3
    4
    asnp Microsoft.SharePoint.PowerShell
    $wa = Get-SPWebApplication http://intranet.xxxx.com
    $wa.CrossDomainPhotosEnabled = $true
    $wa.Update()
    This will resolve your second error on search result page.