SharePoint – User Profile Image Cross-Site with ADFS

If you have spread the MySite and a web application into separated SharePoint Web Application and both of these is using AD FS for authentication. You maybe noticed that you are not able to load user profile thumbnails from the MySite. This is because a token is not issued from the MySite web application and Cross-Origin Resource Sharing (CORS) that is a security measure.

But luckily Microsoft have acknowledged this and have added a PowerShell command that allows to load pictures/resources from other SharePoint web applications on the same farm.To enable this, use the following PowerShell snippet, remember to run it in the SharePoint Management Shell.

Basically it uses the userphoto.aspx, to make the request to the other web application. It will change the “src” attribute in the “<img>” tag, from:

And change it to:

Source(s):

  • https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebapplication.crossdomainphotosenabled.aspx

Experienced advanced operations engineer with a demonstrated history of working in the information technology and services industry. Skilled in Windows Server, Azure, Ethical Hacking, Office 365, Exchange, Jenkins, SCCM, Octopus Deploy and PowerShell to name a few. Strong engineering professional with a big passion for knowledge.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.