User Profile Pictures, Exchange 2013, and SharePoint

SharePoint can import user profile pictures from the thumbnailPhoto attribute in Active Directory as a JPEG.  This is done via setting up the Picture property within SharePoint’s User Profile Application.  This is well documented elsewhere, so I won’t go into the process.  However, if you set up a high quality image that fits under the thumbnailPhoto’s 100Kb size limit, user profile pictures within SharePoint look excellent!

Now, what happens when we introduce Exchange 2013 and want to leverage it’s new hi-res images for Exchange 2013 and Lync 2013?  Jeff Guillet, an Exchange Server MVP, has a great article on how to use the new Exchange 2013 cmdlet, Set-UserPhoto.  Set-UserPhoto does two things, it stores a copy of a very high resolution image (up to 648×648 px) in the Exchange 2013 user’s mailbox.  The second thing it does is store a copy of the photo as a 48×48 px image in the thumbnailPhoto attribute.

So say SharePoint imports this 48×48 px image from the thumbnailPhoto attribute.  The thing you’ll notice right away is that the image looks terrible.  It isn’t the 48×48 px image itself that looks bad, but what SharePoint does to the image.  In the Microsoft.Office.Server.UserProfiles.UserProfilePhotos.CreateThumbnail internal method, SharePoint creates 3 different thumbnails for the imported photo of varying sizes:

Large = 300×300 px

Medium = 72×72 px

Small = 48×48 px

SharePoint is also using the highest quality options available to scale the image from the System.Drawing.Drawing2D namespace:

But, any way you slice it, a JPEG upscaled from 48×48 (thumbnailPhoto) to 300×300 px (user profile photo store) is going to look terrible.  So how do you get the best of both worlds?  My current suggestion would be to run this PowerShell, using both the Exchange Set-UserPhoto cmdlet and the Active Directory Set-ADUser cmdlet.

If anyone has a better suggestions, please let me know!

7 Comments

  1. You shouldn’t do this.
    The thumbnailPhoto attribute should only contain images up to 100KB: http://blog.cjwdev.co.uk/2010/11/03/the-thumbnailphoto-attribute-explained/ or see the documentation: http://msdn.microsoft.com/en-us/library/cc221395.aspx. The way it looks to me SharePoint should talk directly to Exchange as seen in this diagram from MS: http://zoom.it/p68o#full – a full writeup of how to use the High Resulution Photos from Exchange can be found here: http://blogs.technet.com/b/jenstr/archive/2012/08/13/using-exchange-2013-preview-high-resolution-photos-from-sharepoint-server-2013-preview.aspx

    • 100Kb was noted in the article, but I do see what you mean in the last PowerShell cmdlet, there should be two separate photos, one high-quality for Exchange, the other a max of 100Kb for down-level servers (not necessary SharePoint 2013). Note that the thumbnailPhoto attribute will prevent you from placing an image >100Kb into the attribute.

      • Right – if you had a >100KB image in $photo it would work. More important is the last link I suggested: There is an official method of making SharePoint 2013 work with Exchange 2013 User Images. And it’s not via the Active Directory workaround posted here :-)

        • Yes, for SharePoint 2013 there is an official method, but for down-level servers or situations where there is a security or political issue between SharePoint 2013 and Exchange 2013, this is an alternate method to get an acceptable picture into SharePoint while maintaining a high-quality picture in Exchange 2013.

  2. Pingback: Lync, Exchange, and Active Directory Photos | Notes by Tom

  3. Pingback: Dealing with User Photos in Exchange 2010 and 2013 | Mello's IT Musings

Leave a Reply