I have experience this issue on few customers’ environments. Sometimes, it will just only require to reboot the server hosted the user profile synchronization process.
If the reboot does not in your scenario, you may try to reset the user profile synchronization before recreating the entire User Profile Service Application.
The official Microsoft TechNet article is available here, however, I found some instruction in “Reset Sync Database” is not very accurate.
Before you start
- Backup the User Profile Service Application or Backup the user profile service databases (social database, profile database and sync database). This procedure will only reset the sync database
- The user account (I used the setup account) that performs this procedure is a member of the Farm Administrators group on the computer that is running the SharePoint Central Administration website.
- The user account (SharePoint Farm Account) that performs this procedure is a member of the Administrators group on the computer on which you installed the User Profile synchronization service. This is required to start the User Profile Synchronization service. After the User Profile Synchronization service is started you can remove the farm account from the Administrators group
- Record the configurations – The process will reset the sync database and you will lost all the active directory synchronization settings. You should record these setting before staring the process.
- User Profile Synchronization Connection Settings (such as sync account, OU)
- Active Directory Import Filter
- Disable the SharePoint Timer Jobs
- Download and unzip the ResetSyncDB
- Open the “ResetSyncDB.ps1″ and
- update the $syncdbName to your Sync Database Name
- update the $upaName to your User Profile Service Application Name
- Save and close the file
- Open the “ExecuteResetSyncDB.ps1″
- update $ScriptFile to the correct path.
- Save and Close the file
- Right click on “PowerShell” and select “Run as Administrator”
- Execute the “ExecuteResetSyncDB.ps1″ and it will prompt for the SharePoint Farm password
- Enter the password and it will execute the “ResetSyncDB.ps1″ under the SharePoint Farm account. It will prevent the problem for modify the Database security in the TechNet article.
- Once it is completed, you will need to start the “User Profile Synchronization” service
- Once it is started, you are good to reconfigure the synchronization connection and profile
- Before you enable the “My Site Cleanup Job”, you should run two full synchronization and check there is any “Profile Missing from Import”