0

I have imported profile pictures from AD and is successfully synchronizing. The problem is that SharePoint is looking for the picture at the wrong location.

In the console i get this error:

GET http://sis-intranet/sites/mysiteUser%20Photos/Profile%20Pictures/sr_SThumb.jpg?t=63540923150 404 (OK) 

This is because the link should be http://sis-intranet/sites/mysite/User%20Photos/ not http://sis-intranet/sites/mysiteUser%20Photos/

It's missing the "/" after mysite

Any idea how to fix this?

2
$site = get-spsite "http://sis-intranet"

#Give URL of a site collection whose web application is associated with this user profile service application 
$context=  [Microsoft.office.server.servercontext]::GetContext($site) 
$userProfileManager = new-object Microsoft.office.server.userprofiles.userprofilemanager($context) 
$profiles = $userProfileManager.GetEnumerator() 
   foreach ($profile in $profiles) 
    { 
    $Matchurl = "http://sis-intranet/sites/mysiteUser%20Photos/" 
    #Provide the incorrect URL for the picture 
     if($profile["pictureurl"].value -match $matchurl) 
        { 

                Write-host $profile["AccountName"].value "contains incorrect url" 
                $CurrentURL = $profile["Pictureurl"].value 
                $CurrentURL = $CurrentURL.tostring() 
                $GoodUrl = "http://sis-intranet/sites/mysite/User%20Photos/" 
                #Provide the correct URL for the picture 
                $CorrectUrl = $CurrentURL.replace($matchurl,$goodurl) 
                $profile["pictureurl"].value = $correcturl 
                $profile.commit() 
                Write-host $profile["AccountName"].value "PictureURL has been corrected" 
       } 
    }

http://blogs.technet.com/b/harmeetw/archive/2012/09/18/sharepoint-2010-profile-pictures-not-showing-up-due-to-incorrect-url.aspx

EDIT

yes its not permanant! you need to rebuild the user profile service so that it picks up the correct url. where are you picking up the image from? active directory? have you looked into the user profile settings in active directory? _admin/ServiceApplications.aspx goto user profile and under people click on manage user properties -> look for profile images and make sure its correct

  • I looked at that. The problem is that it doesn't seem to be a permenant fix. For each time a new user is added, this script must be run in order to get the url correct. – Koiski Jul 14 '14 at 10:04
  • yes its not permanant! you need to rebuild the user profile service to that it picks up the correct url. where are you picking up the image from? active directory? have you looked into the user profile settings in active directory? _admin/ServiceApplications.aspx goto user profile and under people click on manage user properties -> look for profile images and make sure its correct – Ali Jafer Jul 14 '14 at 10:31
  • Deleting and recreating the user profile service fixed this issue. If you update your answer i will mark it as the solution – Koiski Jul 14 '14 at 12:08
  • just ammended my answer, glad to see that you solved your issue! – Ali Jafer Jul 14 '14 at 13:38

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.