Adding images to AD users using a UploadPhoto.ps1 script

Share this:

Hi Folks,

After a long period of holidays it’s time to go back to work/blog/twitter and so forth :).

Let’s start talking how to add images to Active Directory users’ attributes and then using Outlook 2010 we will be able to check these images. Ilse Van Criekinge’s webblog has already covered this process ( and based on that information I created a simple script to help administrator to upload pictures.

The script is really simple. It is called UploadPhoto.ps1 and it can be found here:

To upload a picture to a single user just run UploadPhoto.ps1 <username> and the script will look for a file called <username>.jpg on the default folder (by default is C:Photos) and it will check and then upload the information.

The script can be also used to upload more than a single user at the same time. You can use the switch -all and all files of the default folder will be uploaded to its respective user. Make sure that the file name and mailbox name are the same. Example: user Anderson and file must be anderson.jpg.

This feature is nice if you have all users photos on the same folder, just run once and it will upload all photos in a single shot.

More information about this script:

  • The script uses the folder C:Photos as default repository of the JPG files, you can change to reflect your environment just changing the variable $DefaultPhotoPath.
  • Feel free to change and if you add any new improvement, please let me know and I will update the script with your changes.


Anderson Patricio

Twitter: @apatricio

Technorati : , , , : , , ,
Zooomr : , , ,
Flickr : , , ,

Written by Anderson Patricio

Anderson Patricio

Anderson Patricio is a Canadian MVP in Cloud and Datacenter Management, and Office Server and Services, besides the Microsoft Award he also holds a Solutions Master (MCSM) in Exchange and several other certifications. Anderson has been contributing to the Microsoft Community with articles, tutorials, blog posts, twitter, forums and book reviews. He is a regular contributor here at,, and Anderson (Portuguese).