How to update User Profile Picture in SharePoint 2013 using Powershell
User profiles and user profile properties provide information about SharePoint users currently present in the SharePoint environment. SharePoint User Profile and Users information can be imported from Active Directory.
SharePoint Server 2013 provides the following APIs to work with User Profiles
1.Server Object Model
2.Client Object Model
a. .NET client object model
b. Silverlight client object model
c.Mobile client object model
3. REST API Services
In this article, I will discuss about the changing the existing user profile picture using Powershell commands. Below are the commands given below.
$spsite = New-Object Microsoft.SharePoint.SPSite($siteurl)
$spcontext = [Microsoft.Office.Server.ServerContext]::GetContext($spsite)
$UserProfManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($spcontext)
$myuser = “domainname\sethu”
if ($UserProfManager.UserExists($myuser))
{
$myprofile = $upm.GetUserProfile($myuser)
$myprofile[“PictureURL”].Value = “http://mysite/User%20Photos/Profile%20Pictures/user.jpg”;
$myprofile.Commit();
}
$spsite.Dispose()
Happy SharePointing 🙂