4

I don't come from a heavy SharePoint background so please don't judge :)

I wanted to know if there was a query I can run to delete numerous duplicate User Profiles from the Profile DB. I recently migrated SharePoint 2010 to 2013; previous SharePoint admins have played around with the UPA because it wasn't working correctly and somehow duplicate profiles were shown up. I have the My Site clean up timer job running daily but it doesn't seem to clean up these profiles in the actual DB. I'm running SQL 2012 Standard on SharePoint 2013 Enterprise.

To give you an example, my boss has 5 user profiles in the DB table listed. Only one of the records have most of the columns populated with info but the others look incomplete.

Any help would be appreciated!

@Waqas, I can't comment on your link but I tried that. Do you know of a command that would grab only some of the users on this list? Some users on this list are still active users

3

1 Answer 1

1

You may have orphaned user profiles in your environment, wheich you may need to clean up. That means that a new user with the same domain\username as the old user, then SharePoint would create a new user profile, and not migrate the old.

But if the old user wasn't deleted from the user information list, the new user can't be imported correct, and gets an orphaned account instead. Check if that's true with

$upa = Get-SPServiceApplicatin <identity>
Set-SPProfileServiceApplication $upa -GetNonImportedObjects $true

If you see a list of users here, and you want to get rid of them, just

Set-SPProfileServiceApplication $upa -PurgeNonImportedObjects $true

Out of SharePoint these orphaned users go and you can sync with the directory again to import your new profiles.

This might have to be repeated several times, especially if you're in a live environment where users login during the day. Eventually these orphan user profiles will disappear. If you have a lot of users, the script will take a lot of time - so please be patient unless you get an error from PowerShell.

Reference: SharePoint 2010–User Information Lists and User Profile Cleanup

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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