Quantcast
Channel: SharePoint 2013 - Setup, Upgrade, Administration and Operations forum
Viewing all articles
Browse latest Browse all 21070

User Profile Pictures

$
0
0

So, I am trying to get a picture from a picture library into that user's profile in SharePoint using PowerShell. I've successfully gotten the picture into the PictureURL value but I don't think it's working properly. For one, the picture maintains it's original size (as seen here).  I want SharePoint to go through the process of making the three images (small, medium, and large). Is there a way to perform this operation using PowerShell? Here is my current PowerShell:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$mySiteUrl = "http://mysiteurl"

$site = Get-SPSite $mySiteUrl
$context = Get-SPServiceContext $site
$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)

$profile = $profileManager.GetUserProfile("ADTestUser")
$profile["PictureURL"].Value = "http://mypictureurl/ADTestUser.jpg"
$profile.Commit()

$site.Dispose()

Update-SPProfilePhotoStore -MySiteHostLocation $mySiteUrl -CreateThumbnailsForImportedPhotos 1


Viewing all articles
Browse latest Browse all 21070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>