Background Information:

Company is the process of moving to a new domain called domain A, from domain B. at one point there was going to be a domain, called domain C that had a few users setup and those users had accessed SharePoint. Domain C has been done away with, and there is no reference to it anywhere except in SharePoint, and to be more exact the old user names "domain C\JohnDoe" appear in the people picker for info path forms.

I have been tasked with cleaning the references to domain C from SharePoint and people picker, and in my research I have found information about mysite clean up jobs, and UIL. I did go to <site collection>/_layouts/people.aspx?MembershipGroupId=0 and remove a bunch of domainC\username and those names no longer appear in the people picker. However, there are a few domainC\NamesIveGrownToHate that still appear in people picker but are no where to be found in AD or the UIL.

In even more research I have found people stating that they had to access the database directly to remove problem users such as this. However, I am just an intern and would rather not poke around the database especially when its "not supported".

Is there anyway to clean up the list without going directly into the database?

Extra Info:

0 profiles missing from import (when a full profile sync is ran).

DomainC\users do not show up in manage user profiles in CA (even before I deleted the other users from the UIL).


My Site Cleanup Timer Job


Technet- Profile Cleanup

1 Answer 1


Try this:

$site = Get-SPSite your_site_url
$RootWeb = $site.RootWeb
$users = Get-SPUser -web $RootWeb -Limit ALL | Where-Object {$_.UserLogin -like "domainC\*"}
$users | sort-object $_.UserLogin

If this returns any users, delete them with:

Remove-SPUser -Identity user_listed -Web $RootWeb -Confirm:$False
  • Sorry this is REALLY late, but I forgot to mark your answer as correct. thanks for the help! Commented Jul 12, 2016 at 13:37
  • Can you clarify where I should do this? I'm trying in SharePoint 2013 Management Shell however it doesn't seem to do anything - returning no users even those that should exist.
    – Maureen
    Commented Aug 3, 2017 at 13:57

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.