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();

No comments:

Post a Comment