CSC510219. Do not delete user profile.

Description

User profile deletion is a important thing in the solution arch and you have to be seriosly motivated to do this. Generraly, SharePoint is synchronized with AD. If so and you delete user profile it would issued to unpredictable SharePoint behavoir.

UserProfileManager.RemoveUserProfile method (Guid)
UserProfileManager.RemoveUserProfile method (String)

Be aware that delete extra user profiles from SharePoint are in three steps:
  1. Delete the source accounts in AD.
  2. Re-sync the User Profiles. During this process, user profiles in SP but no longer in AD are marked for deletion. A full synchronization is not required for this marking to occur.
  3. Run My Site Cleanup Job in the Central Administration. This should (but for me doesn’t) purge all profiles marked for deletion from the system. It runs hourly by default.

Resolution

  1. Instead deleteion use custom user profile property to mark as unnesesary for you.
  2. Consider to replace C# code with powershell script.

Links

Delete all User Profiles in SharePoint 2010/2013 using PowerShell
Account Deletion and SharePoint 2010 User Profile Synchronization
Demystifying User Profile Deletion & Mysite Removal

Last edited May 29, 2014 at 2:55 PM by dvd73, version 2

Comments

No comments yet.