How to Import Employee Pictures Into Active Directory

10516

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 would recommend not 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, note that the size of the picture must be less than or equal to 10KB.

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:\Users\exadmin\Pictures\Tree.jpg” -Encoding Byte -ReadCount 0))

How to Import Employee Pictures Into Active Directory Snap 1

The picture that we had imported for the user account can now be seen in Outlook 2010 client.

How to Import Employee Pictures Into Active Directory Snap 2

 

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 on Active Directory Module for Windows Powershell. Note that you can also login to domain controller and perform the same steps.

How to Import Employee Pictures Into Active Directory Snap 3

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:\Users\exadmin\Pictures\Tree.jpg -Encoding byte)

Set-ADUser eric.dane -Replace @{thumbnailPhoto=$photo}

How to Import Employee Pictures Into Active Directory Snap 4