Moving Photos from jpegPhoto to thumbnailPhoto

There are quite a few organizations out there that used the jpegPhoto attribute to store photos of users for use with 3rd party applications. Microsoft is now using thumbnailPhoto as their photo-attribute-of-choice for Exchange 2010 and Outlook 2010. That leaves a lot of us with our photos in jpegPhoto.

Microsoft is now using thumbnailPhoto as their photo-attribute-of-choice for Exchange 2010 and Outlook 2010. That leaves a lot of us with our photos in jpegPhoto wondering what we are supposed to do. Thanks to Active Directory MVP Joe Richards, though, we have a solution! Using Joe's ADFind and ADMod applications you can copy the jpegPhoto data in to the thumbnailPhoto attribute. First, download and unzip these two applications.

Here is an example of how to move a single users (LukeHusky) photo. Note that this example should be one single line if you type it at the command prompt:

adfind -f "(&(objectCategory=person)(objectClass=user)(samAccountName=LukeHusky)(jpegPhoto=*))" 
jpegPhoto -adcsv | admod BIN##thumbnailPhoto::{{jpegPhoto}}

If this works for one user, you can actually run this against ALL users that have data in the jpegPhoto attribute with this command.

adfind -f "(&(objectCategory=person)(objectClass=user)(jpegPhoto=*))" jpegPhoto -adcsv | 
admod BIN##thumbnailPhoto::{{jpegPhoto}} -unsafe

You can also run this so that it will stop after a specific number of errors, such as 5 in the case below:

adfind -f "(&(objectCategory=person)(objectClass=user)(jpegPhoto=*))" jpegPhoto
-adcsv | admod BIN##thumbnailPhoto::{{jpegPhoto}} -exterr -upto 5

As always, make sure that you test before you do an Active Directory-wide deployment of all users.