1

we needed to restore the user profile pictures and succesfully did so. We copied all the images back to the "MySite/User Photos" library and ran the following script to map the images to the users:

$siteurl = "mySiteHost"
$site = New-Object Microsoft.SharePoint.SPSite($siteurl)
$context = [Microsoft.Office.Server.ServerContext]::GetContext($site) users
$upm = New-Object 
Microsoft.Office.Server.UserProfiles.UserProfileManager($context)
if ($upm.UserExists($username)) {
        $profile = $upm.GetUserProfile($username)
        $profile["PictureURL"].Value = ("https://mysite.bauer-de.bauermedia.group/User%20Photos/Profilbilder/" + $file);
        $profile.Commit();
}

This worked but the images now have the wrong dimensions. When I upload my picture from the mysite, it shows as a quadrat. But when I see the images updated with PowerShell, it shows as the same dimensions, the original picture has.

Any suggestions how to fix this without re-uploading the image via User Profile Management manually?

edit: Nevermind. We mapped the MThumb.jpg instead of LThumb.jpg and now it works.

  • Generally, you can run Update-SPProfilePhotoStore to fix up the photo sizes after an update like this. – Matthew McDermott Aug 31 '17 at 22:28
  • Great, added it as an answer for you. – Matthew McDermott Sep 5 '17 at 12:45
2

Generally, you can run Update-SPProfilePhotoStore to fix up the photo sizes after an update like this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.