On Active Directory there is a thumbnailPhoto attribute where you can store user picture (the recommended thumbnail photo size in pixels is 96×96 pixels and should be under 10k in size).
First load ActiveDirectory module on powershell.
Import-Module ActiveDirectory
This first powershell script upload a picture (remember to change [Picture Path] with the path to your picture and [Username] with the AD username that you want to change thumbnailPhoto attribute
$photo = [byte[]](Get-Content [Picture Path] -Encoding byte) Set-ADUser [Username] -Replace @{thumbnailPhoto=$photo}
And the second powershell script download user picture from AD
$user = Get-ADUser [Username] -Properties thumbnailphoto $user.thumbnailphoto | Set-Content [Picture Path] -Encoding byte
UPDATE: Check this http://blogs.technet.com/b/exchange/archive/2010/03/10/3409495.aspx
AD supports 100K pic, but exchange 10K pic. What happens, if pic is bigger than 10K? Is pic unavailable in Exchange/Outlook GAL?
As I now is the Exchange tool that limit you to using images less than 10 KB. If you upload an image bigger that this with different tool, is correctly displayed on Outlook or Lync. Anyway I think is important to keep the size as small as possible for minimize replication traffic.
Excellent site. Plenty of helpful information here.
I’m sending it to some friends ans also sharing in delicious. And obviously, thanks in your effort!