In our test environment i did a full AD import, forgetting to add a filter to get only a single specific department. So now i got all user instead of the one department i wanted.

What would the correct steps be to remove all the users and rerun the UPA sync? Do i only need to apply the filter and run a full sync? And reset the User profile crawl in search?

Any specific timer-jobs that need to be forced?


If it's just a test environment you can run PowerShell to delete the User Profiles that you don't need.

$context = Get-SPServiceContext -Site http://mysite
$upm = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)
#Create a filter if necessary, this will just list them
$upm.GetEnumerator() | Where {$_.DisplayName -eq 'john'} | ft DisplayName
#Finally you can use this to remove the profile

Note: This is NOT a script to run. I did that intentionally since it would be way too easy for someone to erase all their profiles and then blame me. Some assembly is required.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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