User Profile Administrators can no longer upload a picture for a User Profile in the UPA as of June 2011 Cumulative Update

Update: This is resolved in the December 2011 Cumulative Update.

====

There was a code change in the June 2011 Cumulative Update that prevents Administrators of a User Profile Application from uploading profile pictures for users other than themselves.
The code change occurred in Microsoft.SharePoint.Portal.WebControls.ProfileImagePicker function, within the SaveFileToPersonalSite(HttpPostedFile file) method.
Pre-June 2011 Cumulative Update:

June 2011 Cumulative Update:

As you can see, in the June 2011 Cumulative Update, if the Current User is not the user being managed in the UPA, it will throw an error.  Unfortunately the error is not helpful (“There was an error saving the picture.  Please try again later”) to the Administrator, nor is anything useful logged in the Event Log.

16 Comments

  1. Any idea on if this will be fixed? (If it will be a while, is it easy to remove June 2011 CU?)

  2. It has been reported by MS by multiple individuals. Some people have reported this alternate utility works: http://stefvanhooijdonk.codeplex.com/releases/view/41749. I have not personally tried it.

  3. I have confirmed that this is NOT fixed in the August 2011 cumulative, and will opening a ticket in hopes of getting a hotfix.

  4. The author of that alternate utility posted on the page that his utility is broken because of the profile picture issue. Lol Wow. I can understand MS not being able to catch every obscure issue in their CUs, but this completely breaks uploading profile pictures! Pictures are kind of important to, you know, social computing. The very same social computing that MS keeps touting and has drilled into our heads at SharePoint conferences for a year now.

  5. My understanding is that this was introduced in SP1 and is "by-design". Apparently, it was to address some legal/privacy issues. (Don't quote me on that, but I believe it was something to this extent, and is therefore not considered a bug.)

  6. Hmmm, I can not confirm that it's no longer possible uploading pictures on other users mysite.
    We are using this (for this post: stripped) code here:

    $mySiteHostSite = Get-SPSite $MySiteUrl
    $mySiteHostWeb = $mySiteHostSite.OpenWeb()
    $context = Get-SPServiceContext $mySiteHostSite
    $profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)
    $spPhotosFolder = $mySiteHostWeb.GetFolder("User Photos")
    $LocalFoto = Get-Item $LocalFotoPath
    $spFullPath = $spPhotosFolder.Url + "/" + $LocalFoto.Name
    $spFile = $spPhotosFolder.Files.Add($spFullPath, $LocalFoto.OpenRead(), $true)
    $spImagePath = $mySiteHostWeb.Url + "/" + $spFile.Url
    $adAccount = "ourdom" + $userName
    $up = $profileManager.GetUserProfile($adAccount)
    $up["PictureURL"].Value = $spImagePath
    $up.Commit()
    Update-SPProfilePhotoStore -MySiteHostLocation $MySiteUrl
    $mySiteHostWeb.Dispose()
    $mySiteHostSite.Dispose()
    and it worked!
    Why is there a difference? Anyone?

  7. The difference with PowerShell is that you're not going through the Microsoft.SharePoint.Portal.WebControls class to upload the picture, so you avoid the problem entirely.

  8. I used the script from OKEO and i get this error below. Can someone help me with this problem?

    Method invocation failed because [System.String] doesn’t contain a method named
    ‘OpenRead’.
    At C:\sp\test.ps1:11 char:69
    + $spFile = $spPhotosFolder.Files.Add($spFullPath, $LocalFoto.OpenRead <<<< (), $true) + CategoryInfo : InvalidOperation: (OpenRead:String) [], RuntimeE xception + FullyQualifiedErrorId : MethodNotFound Update-SPProfilePhotoStore : Error processing the photo URL for user venlo\hrm snh01: System.ArgumentException: Value does not fall within the expected range. at Microsoft.SharePoint.SPWeb.GetFile(String strUrl) at Microsoft.Office.Server.UserProfiles.PowerShell.SPCmdletUserProfilePhotoS tore.InternalProcessRecord() At C:\sp\test.ps1:17 char:27 + Update-SPProfilePhotoStore <<<< -MySiteHostLocation $MySiteUrl + CategoryInfo : WriteError: (:) [Update-SPProfilePhotoStore], SP Exception + FullyQualifiedErrorId : Microsoft.Office.Server.UserProfiles.PowerShell. SPCmdletUserProfilePhotoStore

  9. Does anyone know if this will be addressed in the October 2011 CU?

  10. I can confirm this is NOT fixed in the October 2011 CU. I have opened up a case with Microsoft.

    Phil

  11. The October 2011 CU is not quite out yet for SharePoint 2010. Hopefully in the next few days we'll see it. There was an updated August 2011 CU (original release .5002, updated to .5005) that was released during the month of October.

  12. The October 2011 CU was released tonight and has not resolved this issue.

  13. Has anyone who opened a case with Microsoft for this gotten a fix?

  14. Was told today by MS that it is scheduled to be fixed in the December CU.

    -Phil

  15. Has this been fixed?

  16. Yes, it was fixed in the Dec 2011 CU.

Leave a Reply