Monday, December 2, 2013

Getting pictures placed with users on Active Directory + Exchange

If you're looking to get user photos working on your Exchange contact lists, there is a little bit of process involved. You'll need a copy of jpegtran and Image Resizer installed on either the server or a workstation to generate the correct picture imports.

  • Resize any copies of photos you need to 96x96 px using Image Resizer.
  • The photos need to be under 10KB. Use jpegtran.exe -optimize OLD.jpg NEW.jpg on each picture to accomplish that.
  • Fire up the Exchange Powershell console on your mail server.
  • Get-ADGroupMember Employees | select name > userlist.txt
  • Using the names from the userlist.txt file, do an Import-RecipientDataProperty -Identity "PERSON" -Picture -FileData ([Byte[]]$(Get-Content -Path "FILENAME" -Encoding Byte -ReadCount 0)) on each user that has a picture waiting for him or her.

  • Footnote: I usually attribute what I can, but since I took the Powershell command notes, I have lost track of their original source.