Sign up ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to overwrite the existing user profile that are in sp with my own one.

public string AccountName { get; set; }

public string WorkPhone { get; set; }

public string Department { get; set; }

public string Title { get; set; }

public string DistinguishedName { get; set; }

public string WorkEmail { get; set; }

public string Office { get; set; }

        protected void Page_Load(object sender, EventArgs e)

        public void Create()

            string socialDataStatsSite = SPContext.Current.Site.Url;

            using (SPSite siteColl = new SPSite(socialDataStatsSite))

                SPServiceContext serviceContext = SPServiceContext.GetContext(siteColl);

                UserProfileManager userProfileManager = new UserProfileManager(serviceContext);

                UserProfile newProfile = userProfileManager.CreateUserProfile(AccountName, AccountName);








i have put this code in visual studio and deployed it.

Were do i find it in sharepoint to activate it?

share|improve this question
What did you deploy this as? a feature? a web part? – Ryan Erickson Mar 12 '13 at 21:59
@Ryan Erickson hi, in a webpart? – Batistuta Mar 13 '13 at 8:04
If it's in a webpart, then add the web part to a page.. – Fox Mar 13 '13 at 8:10

1 Answer 1

Create a Console Application & run the same or deploy as a feature & activate on the site.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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