How to Import Employee Pictures Into Active Directory

Prajwal Desai
Posted by Prajwal Desai

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))

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 the 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:UsersexadminPicturesTree.jpg -Encoding byte)

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

How to Import Employee Pictures Into Active Directory Snap 4

Share This Article
Prajwal Desai
Posted by Prajwal Desai
Follow:
Prajwal Desai is a Microsoft MVP in Intune and SCCM. He writes articles on SCCM, Intune, Windows 365, Windows Server, Windows 11, WordPress and other topics, with the goal of providing people with useful information.
3 Comments