Sysadminsblog.com Anything for sysadmins!

12Apr/121

Scheduling the Update-SPProfilePhotoStore command

When you setup your SharePoint 2010 User Profile Service to import the user's pictures from Active Directory you will have to run the Update-SPProfilePhotoStore command. Of course you don't want to do this manually every time so you'll need to schedule it on the SharePoint servers in your farm.

The best place to schedule this is on the Central Administration server.

  1. Open the Task Scheduler and click Create Taskā€¦
  2. Enter a name and select an account with enough permissions, in my case the SharePoint Farm account and check Run whether user is logged on or not
  3. Click the Triggers tab and click New. Select a schedule that makes sense to you. I'm sticking to my User Profiles Service Synchronization task schedule.
  4. Click the Actions tab and click New.
    In the Add
    arguments box enter:

    -NonInteractive -NoProfile -Command "& {Add-PSSnapin Microsoft.SharePoint.PowerShell;Update-SPProfilePhotoStore -MySiteHostLocation https://<MysiteHostLocation> -CreateThumbnailsForImportedPhotos 1}"

  5. Click OK and enter the required password

This should start the task every hour and import the Active Directory image right into the User Profile Service which also resizes the images in 3 formats.