1

When user images sync from active directory the image url is https://example.com/sites/mysitesUser%20Photos/Profile%20Pictures/user_MThumb.jpg. I'm missing a slash after mysites. If I manually upload an image within CA it works perfectly. Has anyone run into this before?

6

1 Answer 1

0

Their are couple of ways to fix this kind of issue.

  • Update the Mysite Host with trailing Slash i.e http://mysite/
  • We can update this manually by going to user profile properties inside user profile service application and linking it to the correct picture.
  • Use the powershell to update this.

    here is code:

        $site = get-spsite "http://SiteCollection"     $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://mysitehost/User PhotosProfile Pictures" 
        #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://mysitehost/User Photos/Profile Pictures" 
                #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

1
  • This worked. Though, now I'll have to run a job every night after the profiles sync to correct the picture urls. Seems a little strange that I'd have to do that every night.
    – Ryan
    Apr 24, 2015 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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