Question

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).

Links:

My Site Cleanup Timer Job

UIL

Technet- Profile Cleanup

Was it helpful?

Solution

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
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top