Today am discussing about uploading thumbnail photos to active directory which will help for Office 365 mail system SSO  and Lync users can see the colleague photos

For doing this you should have at least one of the domain controller run on Windows server 2012 R2.


Here is the procedure  for doing this

First you have alias name of all the active directory users and save this file as csv format. Another thing you have passport size photograph for all the users , the size should be less than 10 KB otherwise photo’s  won’t appear in the search directory and save these photos by using the alias name and put the photos and csv files in the Windows server 2012 R2 domain controller.

Here is the option for the mac users to reduce the photo size to less than 10 KB


Use the software called Shrink-o-Matic, by using u can reduce the photos by batch as well as single size also.


In AD domain controller

open active directory powershell

ad powershell

For uploading photo one by one use below command

C:\Users\administrator>$photo = [byte[]](Get-Content “C:\AD Pictures\10288.jpg” -Encoding byte)

(C:\AD Pictures\10288.jpg which is the path of the photo directory in the domain controller)

Run below command for the photo uploading

PS C:\Users\administrator> Set-ADUser m.shiyas -Replace @{thumbnailPhoto=$photo}

For batch uploading photos use the below command

PS C:\Users\administrator>$ListOfUsers=import-csv “c:\adpictures\adpictures.csv”
Foreach($User in $ListOfUsers)

PS C:\Users\administrator>


$photo = [byte[]](Get-Content “C:\ADPictures\$($user.identity).jpg” -Encoding byte)
Set-ADUser $user.identity -Replace @{thumbnailPhoto=$photo}


you can check the AD server whether the photos are uploade dor not . o to the user properties take the attribute editor find “thumbnail photo” there u can see the hexa decimal .