Click here to Skip to main content
15,885,881 members
Articles / Programming Languages / C#
Technical Blog

Adding user profile images to Active Directory and SharePoint 2007

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
31 Oct 2013CPOL1 min read 7K   1  
Adding user profile images to Active Directory and SharePoint 2007.

Many companies have a huge collection of employee photographs somewhere, typically for a badge system. The first hurdle was getting the pictures into Active Directory in bulk. The images were named by the full employee name, not username so it was difficult to match them together. Luckily Exclaimer Outlook Photos is a free tool that not only imports the photos into Active Directory but also resizes and attempts to match image filenames against the Display Name property. You could also use Bulk Rename Utility to clean up the file names in advance especially if you are knowledgeable with using Regular Expressions to make the necessary modifications.

If I were using SharePoint 2010 or 2013, getting the images mapped into SharePoint would be a simple process of mapping this image field to the field in the User Profile Service. In SharePoint 2007, this process is a little more difficult until I ran across the SUSHI utility on CodePlex. It has a Profile Import Feature that will take a folder of images and match them by username to profiles in SharePoint. Well going back to the original problem of getting the images named by username instead of full name I was able to take the uploaded images in Active Directory and export them in bulk using the follow PowerShell command:

Import-module ActiveDirectory
Get-ADUser -Filter * -Properties thumbnailphoto | where {$_.thumbnailphoto} | foreach {$_.thumbnailphoto | Set-Content -Path “C:\temp\$($_.SamAccountName).png” -Encoding Byte}

This dumped all of the images into a folder that SUSHI could then use to upload from. Hopefully this helps walk you through the process of getting a bunch of useful images sitting on a drive doing nothing and get them integrated into your environment.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Systems / Hardware Administrator
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --