Probably you already know the feature of synchronizing SharePoint User Profiles with your company’s Directory (common scenario is sync with AD); if not, there are plenty of resources; take a look at technet article for example: http://technet.microsoft.com/en-us/library/ee721049.aspx
What I’m discussing in this post, is related to some problems and different behavior between SharePoint 2007 and 2010 to handling User Profile Pictures.
Within SharePoint 2010, photos are handled by the User Profile Service Application (UPS Application) in “Picture” attribute (of type URL), and stored, as long as all other user attributes, inside the related User Profile Property Store Database.
On the Active Directory side (AD), employee photos are normally (=predefined by design) stored in a blob attribute, called thumbnailPhoto (jpegPhoto attribute doesn’t work!), and it support images up to 10k and not bigger than 96 x 96px. However (…and here comes the problem with SharePoint 2010) you can also choose to put the employee photo URL (not the entire bitmap but the adress only) on another LDAP AD attribute (e.g. one of the extensionattributes), becasue of the fact that your company already have a place (HR portal, directory) where the photos are posted, maintained and collected.
So, if you used (or are planning) to store the photos by sync-ing SP Picture attribute with AD thumbnailPhoto attribute, you are lucky because this is the standard method Microsoft delivered. For completeness, I’ll resume the OOTB scenarios:
- Export from SharePoint: Upload pictures from SP (via MySite), then configure export to write to AD (thumbnailPhoto LDAP attribute)
- Import to SharePoint: Import from AD (thumbnailPhoto) to SP (NOT POPSSIBLE ON RTM release! In order to work it requires you to install at least the October CU KB 2394320 http://support.microsoft.com/kb/2394320): Note: in this scenario the saved photo must be a JPEG (Steve’s blog)!
In order to let these procedures work, you have to setup the correct permissions “Replicate Directory Changes” in read/write (depending of the export/import scenario you are setting up) on AD (see http://blogs.technet.com/b/steve_chen/archive/2010/09/20/user-profile-sync-sharepoint-2010.aspx).
If your policies requires you to use a different mechanism to import employee’s photos in SharePoint, some problems may arise, and additional effort is required to achieve the goal.
If you come from older SharePoint releases, In SharePoint 2010, handling user’s pictures differs from 2007. For example, on the MOSS 2007, you were able to map an AD attribute of type string (e.g. extensionattributes) to the “Picture” SharePoint attribute, and during user profile synchronization process, the atttribute value on AD was copied on the Picture attribute value on MOSS.
On the newer version it’s no more possible (altough possible in an unsupported way, then no possible, or to avoid at least!), because of a change in the attribute type, and a “special” Picture handling performed by 2010 platform.
As a reference: Mapping property AD (string) to PictureURL (SP): http://www.chaitumadala.com/2010/05/setting-up-pictureurl-user-profile.html guides you to change some mappings in FIM, but modifying this component (in regards to SharePoint) is NOT supported!
An available option to import profile pictures on SharePoint is to write an application or script (e. g. powershell) to modify the PictureUrl property value (for a code sample see this MSDN article: http://msdn.microsoft.com/en-us/library/ff721968.aspx).
Profile Picture internals (on SP 2010)
What really happens when you upload your profile picture?
- The bitmap is being read
- the original picture is saved 3 times (with different names and formats) in “User Photos”/”Profile Pictures” folder:
- 64 x 64px
- 96 x 96px
- 128 x 128px
If you created an application (or script) to set an URL value for PictureUrl property, you can use this powershell command to trigger the above-mentioned step 2:
Update-SPProfilePhotoStore -CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation <mySiteHostURL>