Updating User Profile pictures with powershell on SP2010




$CSVFile = "C:\Scripts\pictureurls.csv"
$mySiteUrl = "http://people.contoso.com"

#Connect to the User Profile Manager
$site = Get-SPSite $mySiteUrl
$context = Get-SPServiceContext $site
$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)

#Read CSV file and process each line
$csv = import-csv -path $CSVFile
foreach ($line in $csv)
$up = $profileManager.GetUserProfile($line.UserName)
if ($up)
$up["PictureURL"].Value = $line.PictureUrl
if (!$up) {



3 thoughts on “Updating User Profile pictures with powershell on SP2010

  1. A bit misleading title. Post is about changing URLs in profiles, but not updating / changing the actual pictures stored on some location, but it is a good post!

    Due to GDPR regulations I am searching for something that will let me remove profile picture of a person from certain location in Sharepoint online.

    I have cleared all the data in the profile so nothing is now visible but getting some troubles, as when admin goes to the location where all the profiles are, he will see that picture. The problem is location which is https://-my.sharepoint.com/User%20Photos/Forms/Thumbnails.aspx and there is a folder called “profile pictures”, and somehow cannot go into it to clear particular pictures.

    Do you have any ideas how to read/remvoe such items?

Leave a Reply
