SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can anyone tell me how to delete a SharePoint user profile remotely? I don't see a way to do this using SharePoint Web Services or User Profile Services. The following code works fine when run on the SharePoint server but will not work remotely. When it tries to the run the constructor for SPSite it throws an error about not being able to find Microsoft.Sharepoint.Intl which is in the GAC on the SharePoint server.

using (new Person.Utilities.Impersonation.Impersonator("sharepoint.service", "fakeDomain", "fakePassword", Person.Utilities.Impersonation.LogonType.LOGON32_LOGON_NEW_CREDENTIALS, Person.Utilities.Impersonation.LogonProvider.LOGON32_PROVIDER_WINNT50))
    using (SPSite site = new SPSite(""))
        ServerContext context = ServerContext.GetContext(site);
        UserProfileManager profileManager = new UserProfileManager(context);
        if (profileManager.UserExists(username))
share|improve this question

migrated from Aug 24 '12 at 12:56

This question came from our site for professional and enthusiast programmers.

Pretty sure this just can't be done remotely. You'll need to create a web service or in some other way have code running on the server that you trigger remotely. – Servy Aug 23 '12 at 15:52
You would have to use the REST based API or write your own web service. Server OM code must run on the server. – Robert Kaucher Aug 23 '12 at 15:58

Have you checked out this article. This guy is using WCF to update the user profile properties. Hope this helps.

share|improve this answer

Your Answer


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