Within our SPS 2003 environment we stored employee pictures in a picture library. We then set the users Picture URL profile property to point to their picture in this library. The problem was that as soon as we upgraded the paths to these pictures no longer worked. Our pictures were previously found under the path "http://intranet/HumanResources/EmployeePictures/" but after the upgrade the path changed to http://intranet/Topics/Divisions/HumanResources/EmployeePictures/.
So we needed a way to reset the path for all the users in the profile database to reflect this new path (note that in the end we intend to move the photos to a different location as the Topics and Divisions sites that were created will be dumped). My solution was a fairly simple command, called gl-setpictureurlnewpath, which takes in the path to the new picture library and resets all profile users PictureUrl property to reflect this new path. I assume that all the filenames are not changing and that all the photos are in this single library (if your environment has users with photos in different libraries then you’ll want to modify this code to take in another variable to help you determine which ones to change). The core code that does this is shown below:
The syntax of the command I created to do this can be seen below.
C:\>stsadm -help gl-setpictureurlnewpath stsadm -o gl-setpictureurlnewpath Fixes the pathing for all user photos or a single user's photo as the result of moving a picture library (assumes file names have not changed). Parameters: -sspname <name of the 2007 SSP> -librarypath <path to new photo library (i.e., "http://intranet/HumanResources/Employee%20Pictures/")> [-username <NT account name>]
Here’s an example of how to change the picture url path for all users:
stsadm –o gl-setpictureurlnewpath –sspname “SSP1” –librarypath "http://intranet/hr/EmployeePictures"