SharePoint 2010–Photo Management for Social & MySites


In SharePoint 2010, the product team has done an excellent job giving some love to the mySite features, User Profiles, and using this information to integrate throughout SharePoint in order to promote some of the social features that they’ve been busy integrating into the new version.  They’ve also given a nod to some of the more corporate concerns for large scale implementation by allowing better governance so that administrators can more easily lock down or modify the profiles based on what company policies might dictate, providing administrators with an easier way to manage these photos by storing them in a central location.

The SharePoint 2010 profile picture story:

SharePoint 2010 maintains three differently sized thumbnails of the profile pictures to be used in different contexts in the product. Out of box, we use the large (144×144 px) thumbnail on the profile page contact card, the medium (96×96 px) thumbnail on the people search results page and the small (32×32 px) thumbnail on various web parts and controls displaying people data like the Newsfeed, Colleagues, In Common With You, Note Board and many others.

When a user uploads his profile picture using the photo upload UI on the “Edit Profile” page, SharePoint resizes the uploaded image to create 3 thumbnails of above mentioned sizes. Images are not cropped, just resized in order to maintain the original aspect ratio, so that the largest dimension matches the target thumbnail dimension. If the original image is smaller than the target size, the small image becomes the thumbnail instead of stretching it to meet the target. Here are some examples:














All the photo thumbnails are stored in a folder named “Profile Pictures” under a Picture Library called “User Photos” under the MySiteHost site collection. Thus, we now have a centralized photo store holding the profile images for every user.  This makes it very easy for admins responsible for picture “appropriateness” to quickly scan through the library for any offensive materials.

The following naming convention exists for the thumbnail files:



Image File Name











The full URL of the medium thumbnail (like, “ http://<mysitehost>/User Photos/Profile Pictures/<domain>_<username>_MThumb.jpg”) is stored in the user profile database.

SharePoint 2010 expects all the 3 thumbnails to be stored at the same location and follow the above file naming convention. Depending upon the context where the photo is rendered, SharePoint decides what thumbnail size to use and generates that URL from the _MThumb URL.

What does this mean for you?

As we’ve seen, there is some fairly substantial change in how the profile photos work in 2010. Let’s discuss how this affects you and how to make some common scenarios work:

Upgrading from 2007:

In 2007, we did not have the 3 differently sized thumbnails and the picture URLs in the 2007 profile database did not follow the new naming convention. If you simply use the data from the 2007 database, SharePoint UI will use the same picture URL in every context because we wouldn’t know how to pick the correct thumbnail size. This way we will possibly render a big image in an area meant for a smaller image and end-up with a broken page layout. So, we need to migrate the data from 2007 database to the new 2010-style format. We provide a powershell cmdlet to be run after upgrade to achieve this. From the SharePoint Management console, run:

Update-SPProfilePhotoStore -MySiteHostLocation http://<my site host URL>

This cmdlet would iterate over each user in the profile database, download their existing profile picture, create 3 correctly sized thumbnails from it and save them with proper names under the My Site Host “User Photos” picture library. On successful thumbnail creation, it will update the picture URL in the profile DB to the URL of the medium sized thumbnail.

The cmdlet updates the profile database, so it needs to be run from an account with the following permissions:

1. Connection permission to the User Profile Application on the Services farm. You can check this by going to Central Admin on the Services farm, navigating to the “Manage Service Applications” page, selecting the “User Profile Application” from the list, and then clicking the “Permissions” button in the UI. Only the accounts listed in there have permission to run UserProfile OM code.

2. “Manage Profiles” rights on the User Profile Application. Click on the “Administrators” button after selecting the “User Profile Application” and check the “Manage Profiles” check box.

Troubleshooting the cmdlet:

In case of any error in processing a given user’s picture (like the picture URL is invalid or unavailable), the cmdlet will skip the user and continue processing the remaining users. To capture a log of all errors and successes, you can turn on verbose and save the cmdlet output using Start-Transcript. Re-running the cmdlet will help fixing most cases, like, if a bunch of pictures were unavailable due to some network problem. The cmdlet skips picture URLs that follows the 2010 naming convention (that is, end in _MThumb), so re-running will only try to process the failed users.

Managing the photo store yourself:

Many companies want to create their own customized experience for photo upload and storage. If you are doing this, you should make sure to be compatible with the 2010 photo usage mechanism. This mainly boils down to following these rules:

1. Create three thumbnail image files of the standard sizes (larger dimension = 32, 96 and 144). There’s no standard SharePoint OM/web service to create image thumbnails – you have to use your own resize mechanism to create them, you can also ask the user to upload 3 different images if you choose to.

2. Name the image files following the SP 2010 naming convention (large ending in _LThumb, medium ending in _MThumb and small ending in _SThumb).

3. Store all the 3 thumbnail images at the same location (because SharePoint will try to generate URLs for the other two thumbnails from the medium thumbnail)

4. Use our OM to set the full URL of the medium (_MThumb) thumbnail as the PictureURL profile property for the user.

As you can see, Microsoft has put a lot of effort in increasing the social features of SharePoint 2010, with an eye towards making the integration of people and content more seamless to the user experience.  Very nice!

FAST Search–100 Year Certificate Expiration

So one of the fun things about setting up FAST for development is that when you set up a development environment you have the option of creating a self-signed certificate if you want to set up HTTPS communication between FAST and SharePoint – always a good idea if you are doing the same in production as you want to make sure that the SDLC farms match production as closely as possible.  Unfortunately what this means is that you now have a cert that is valid for one year after installation.  As with most environments, it seems as if the DEV and QA environments don’t always get as closely monitored as production, and when things go sideways in these environments you don’t always have all hands on deck helping you figure out what happened.  Either that or you have to remember to up the cert every year… tedious for SDLC environments and often forgotten about when employees leave, or you have to have some sort of non-expiring certificate.  We don’t have perpetual certificates, So how to keep your DEV and QA environments in a stable and low maintenance state?  100 year expirations on your certs!

If you are running FAST on Windows Server 2008 R2 here’s an easy solution to generating 100 year certs for your environments:

1) Open up C:\FASTSearch\installer\scripts\include\certificatesetup.ps1 and scroll down to line number 246 which reads:

Add-Content -Path $infFile -Value "SuppressDefaults=true"

2) Append the following lines underneath it:

Add-Content -Path $infFile -Value "ValidityPeriod=Years"
Add-Content -Path $infFile -Value "ValidityPeriodUnits=100"

3) save the file.

4) Then recreate your certificate with replacedefaultcertificate.ps1 as explained at TechNet. Remember to import it on your SharePoint 2010 server as well.  If you apply this edit during installation of FAST for SharePoint you save yourself a step and now you have an environment that potentially will give you one less headache a year from now.