How to Import Employee Pictures Into Active Directory
In this post we will see how to import employee pictures into Active Directory. There are several ways of importing the pictures into Active Directory, what i mean by importing pictures is that you can add a picture in Active Directory and it will be displayed in Outlook and Lync client.
There are lot of third party softwares that can import the photos, edit the photos and set the photos for user accounts. I wouldn’t recommend to install any third party software for setting up the picture for user account.
In this post we will be using a simple command to set a picture for user account. Remember that the size of the picture must be less than or equal to 10KB.
How to Import Employee Pictures Into Active Directory
We will use an exchange command Import-RecipientDataProperty to set the picture for the user account. Login to the Exchange Server 2010 with an Exchange administrator account and launch the Exchange Management Shell.
Type the command
Import-RecipientDataProperty -Identity "Username" -Picture -FileData ([Byte[]] $(Get-Content -Path "Provide path to pic" -Encoding Byte -ReadCount 0))
Example –
Import-RecipientDataProperty -Identity "Eric.Dane" -Picture -FileData ([Byte[]] $(Get-Content -Path "C:UsersexadminPicturesTree.jpg" -Encoding Byte -ReadCount 0))
The picture that we had imported for the user account can now be seen in Outlook 2010 client.
You can use the PowerShell command to set the picture for user in Active Directory.
Login to exchange server and click on start and type PowerShell in search programs and files text box.
Click the Active Directory Module for Windows PowerShell.
Note that you can also login to domain controller and perform the same steps.
Syntax of the command –
$photo = [byte[]](Get-Content path of pic -Encoding byte) Set-ADUser username -Replace @{thumbnailPhoto=$photo}
Example –
$photo = [byte[]](Get-Content C:UsersexadminPicturesTree.jpg -Encoding byte) Set-ADUser eric.dane -Replace @{thumbnailPhoto=$photo}
Hai,
Need help about how to config Microsoft AD custom lock on screen for Windows 10 client PC on organisation enviroment?
Thanks a lot.
@Kris – I had the script but I lost it :(.
Hi
I’m looking for a solution to add not only one picture to AD but a few. Code below:
$photo = [byte[]](Get-Content C:UsersexadminPicturesTree.jpg -Encoding byte)
Set-ADUser eric.dane -Replace @{thumbnailPhoto=$photo}
works perfect but only for one picture. I need script to add more than one picture.
I am not a programmer so could you help me ??