We are looking at putting photos in Active Directory. We have many domain controllers, some are in areas with not a lot of bandwidth. What are the recommend/max files sizes for photos or is this a bad idea to begin with. We are currently storing these in SharePoint and want to turn on the sync service to AD for profile photos.

My other thought was somehow telling AD to use SharePoint's storage for the photo but not sure if that's even possible.

How can I put staff photos in AD and mitigate as many replication / bandwidth issues as possible?


It's not a terrific idea for a couple of reasons. One of those reasons is that the photos are stored in the Active Directory database. So it doesn't matter if you host the photos on a DFS share with a DFS namespace or whatever. You convert the photo into bytes and store it in the "thumbnailPhoto" schema attribute of the user account object, therefore it directly increases the size (and therefore the replication load) of the Active Directory database.

Whatever the official max size is, you need to say WAY below that and keep the pictures absolutely as tiny as possible.

This Powershell code will update your thumbnailPhoto attribute.

Import-Module ActiveDirectory

$photo = [byte[]](Get-Content C:\photo.jpg -Encoding byte)

Set-ADUser user -Replace @{thumbnailPhoto=$photo}

Users do have access to modify their own thumbnailPhoto attribute by default. So you also need to be wary of abuse by end users. I was able to make this work with either a .bmp or a .jpg and I think a .png as well.

That will make the photo show up in your Exchange emails and such. But that doesn't replace the "user tile" that you see in you Windows 7 / 2008 R2 start menu, RDP logon dialog, etc. That is something separate.

Please see these posts for more detail on these two different types of account pictures: http://www.myotherpcisacloud.com/post/2011/11/28/Default-Account-Pictures-via-Active-Directory.aspx

http://www.myotherpcisacloud.com/post/2011/12/02/More-Pictures-with-AD-thumbnailPhoto.aspx

Oh, and to answer your question, this blog post claims that the real size is 100KB and it has been since the attribute was introduced in Windows 2000:

http://cjwdev.wordpress.com/2010/11/03/the-thumbnailphoto-attribute-explained/

One last thing -- there are other schema attributes that, well, don't do anything. They're vestigial I guess. Don't let them confuse you.