Showing posts with label user profile picture. Show all posts
Showing posts with label user profile picture. Show all posts

Friday, 13 April 2012

Update the user profile picture in SharePoint

SPServiceContext context = SPServiceContext.GetContext(SPContext.Current.Site);
UserProfileManager profileManager = new UserProfileManager(context);
UserProfile theProfile = profileManager.GetUserProfile(SPContext.Current.Web.CurrentUser.LoginName);
theProfile["PictureUrl"].Value = "<img url>";
theProfile.Commit();