Q. How can I add pictures for my users into Active Directory (AD)?
The thumbnailPhoto attribute in the AD schema can store pictures of users. Ideally, these pictures should be 96×96 pixels and less than 10KB, though they can be up to 100KB.
July 13, 2011
A. The thumbnailPhoto attribute in the AD schema can store pictures of users. Ideally, these pictures should be 96×96 pixels and less than 10KB, though they can be up to 100KB.
Related: Q: Is there a free GUI application for updating user photos stored in Active Directory?
If you want to populate this attribute, the first thing to do is to make sure the thumbnailPhoto attribute is replicated to the Global Catalog. Run the command
Regsvr32 schmmgmt.dll
then run mmc.exe and add the Active Directory Schema MMC snap-in. Navigate to Attributes and, under the Properties of thumbnailPhoto, ensure Replicate this attribute to the Global Catalog is checked, as shown here.
There are various ways to populate the thumbnailPhoto attribute. SharePoint MySite functionality allows users to set their photo, or you can use the Exchange 2010 Import-RecipientDataProperty PowerShell cmdlet to set the picture, as seen here for two users:
[PS] C:>Import-RecipientDataProperty -Identity "John 117" -Picture -FileData ([Byte[]] $(Get-Content -Path "C:usersPublicPictureslogonjohn117.jpg" -Encoding Byte -ReadCount 0))
[PS] C:>Import-RecipientDataProperty -Identity "Cortana" -Picture -FileData ([Byte[]] $(Get-Content -Path "C:usersPublicPictureslogoncortana.jpg" -Encoding Byte -ReadCount 0))
Once this is done, you can see the new picture through Outlook if you hover over a recipient, as shown here.
Learn more about Active Directory & Group Policy.
Note that although the thumbnailPhoto attribute can store up to 100KB, the Import-RecipientDataProperty cmdlet only supports a picture of 10 KB or less.
About the Author
You May Also Like