Part of the new functionality in Exchange is the capability of adding a (very small) thumbnail image. A side benefit of this is that it will show up as the “Default Corporate Image” for Lync, which was the impetus of why I was looking at this in the first place!
Enter an old program I used to use a lot: ImageMagick (www.imagemagick.org)
The trick with these thumbnail images is that the recommended size is 96×96 pixels. But if you just take any photograph and resize it to 96×96, it will most likely be above the size limit you can upload, which is a paltry 10 kb.
Here’s an easy one that will convert most images to below that, and still retain more than enough quality:
convert source-image.jpg -resize 96x96 -quality 85 -strip target-image.jpg
Deceptively simple, but very efficient. It changes the quality of the image but not enough that it is really visible. -strip simply removes all the extras which get added (EXIF information, for instance).
After that, pull up your EMS and do:
Import-RecipientDataProperty -identity target-account -Picture -FileData ([Byte] $(Get-Content -Path target-image.jpg -Encoding Byte -ReadCount 0))
Congratulations – you’ve just updated your Active Directory thumbnailPhoto attribute!