I've setup a sharepoint site that initially had My Sites turned on. One of our users went in and uploaded a picture for their profile. Then we realized we didn't want to use My Sites, so we turned those features off, and removed any of the profiles created under site/my/profiles. This all worked fine except the reference to the picture (along with other fields like About me, Ask Me About, etc.) still remain. How can I remove these, most importantly the Picture reference? If I click Edit, the only option is to add an attachment.

Thanks in advance!

enter image description here

1 Answer 1


I don't think there is any other way, than creating a script that will remove the picture information from User Profile..

Following code will help:

SPSite site = SPContext.Current.Site;
UserProfileManager userProfileManager = new UserProfileManager(SPServiceContext.GetContext(site));
// accountName is Active Directory account
UserProfile userProfile = userProfileManager.GetUserProfile(accountName);
// PictureUrl is the property you need to set.. set it to Empty string..
userProfile["PictureUrl"].Value = string.Empty;
// commit the change

Well you can use Client Object Model and write the code as a Console/Windows application.. In that case you will be getting the reference of SPSite accordingly.. You can also port it as a Powershell script..


Update User Profile picture programmatically in SharePoint

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.