none
SharePoint: Aktualisierung der Profilbilder-URL (PictureUrl) nach MySite Migration RRS feed

  • Allgemeine Diskussion

  • Nach einer Migration/URL-Änderung der MySites ist es meinstens notwending auch die URL des Profilbildes zu aktualisieren.

    Folgende Möglichkeiten stehen Ihnen dafür zur Verfügung:

    • Eine Konsoleaplikation anhand des unteren MSDN Artikels programmieren:

      Microsoft MSDN: Gewusst wie: Ändern der PictureUrl-Eigenschaft aller Benutzerprofile in einer Websitesammlung
    • Diesen, anhand vom o.g. Artikel, angepassten PowerShell Skript benutzen:

      #Add-PSSnapin Microsoft.SharePoint.Powershell
      
      [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
      [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.UserProfiles")
      
      Start-SPAssignment -Global
      
      $s = Get-SPSite "http://mysite_url"
      $c = Get-SPServiceContext $s
      
      $profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($c)
      
      $profiles = $profileManager.GetEnumerator();
      
      foreach ($profile in $profiles)
      {
      
       $oldurl = $profile[[Microsoft.Office.Server.UserProfiles.PropertyConstants]::PictureUrl].Value;
      
       if($oldurl -ne $null)
       {
      
       $newurl = $oldurl.Replace("http://alte_url/", "http://neue_url/");
       $profile[[Microsoft.Office.Server.UserProfiles.PropertyConstants]::PictureUrl].Value = $newurl;
       $profile.Commit();
      
      Write-Host "Benutzer: " $profile[[Microsoft.Office.Server.UserProfiles.PropertyConstants]::AccountName].Value
       Write-Host "Neues Profilbild-Pfad: " $profile[[Microsoft.Office.Server.UserProfiles.PropertyConstants]::PictureUrl].Value
      
       }
      
      Stop-SPAssignment -Global
      

    • Bearbeitet Alex Pitulice Mittwoch, 24. August 2011 15:04 Inhalt SEO
    Donnerstag, 10. März 2011 13:55
    Moderator