How to Reprovision User Profile Sync in SharePoint

Reprovision user profile sync is one of the last things I would try in an effort to get the SharePoint sync working. This has fixed sync issues many times. Recently, because of server version mismatch issue explained in this blog, user profile synchronization started throwing errors.

There are many articles in the internet when i searched for this error.

I tried many other options, like stopping and staring UPS and clearing the SharePoint cache. I also made sure that there is no issue with AD.

This issue surfaced only in one of many server farms. This made it clear that it has something to do with this server farm alone. Reprovisioning user profile sync solved many sync issues for me in the past. So, I have decided to give it a try.

As always, if you are working in Production farm, please backup Profile, sync and Social databases.

As a precautionary measure, it is a good idea to document synchronization connections, connection filters and any custom property mappings. Because at the end of the process, we need to reconfigure all these settings.

There are many other blogs written on the same process. I am writing it as a note for future myself to refer, next time I face anything like this. Here are the steps to follow to Reprovision User Profile Sync

  • Stop the SharePoint Timer Service in the App Server running UPS.
  • Stop User Profile Synchronization service through Central Administration. Central Admin > System Settings .Manage Services on Server > App Server > User Profile Synchronization Service and click Stop
  • Run the following PowerShell in SharePoint Management Shell with elevated permissions

    Get-SPDatabase | Out-File D:\Databases.txt

  • Open the databases.txt file and file the ID for Sync database.
  • Run the following PS commands to remove data in sync database

    $syncDataBase = Get-SPDatabase -Identity “GUID of Sync database”

  • Get the reference to User Profile service, reset and provision the sync database

    $ups = Get-SPServiceApplication -Name “User Profile Service”

  • Verify that Farm admin account has access to sync database in SQL.
  • Start back the SharePoint Timer Service which we stopped in step 1.
  • Start back the User Profile Synchronization Service running in App Server. Central Admin > System Settings .Manage Services on Server > App Server > User Profile Synchronization Service and click Start.┬áThis might take 10-15 mins to start after you enter Farm admin credentials
  • Optional IISRESET
  • Open the User Profile Service Application under Central Admin > Application Management > Manager Service Applications. Configure the synchronization connections and Connection Filters.
  • Rebuilding your SyncDB or recreating connection to Active Directory will mark all user profiles for deletion after first full or incremental sync. Disable MySite Cleaner Timer job to prevent user profiles from getting deleted.
  • Configure any mappings to custom property mappings
  • Run Full Synchronization, twice to sync all the users.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Find all Private channels in a Team

Private channel in a team is an access controlled space available only for Owners and Members of the channel. Guests can be added to private channel as long as they are already member of the team. This should do for a quick intro about private channels. Well, the point of this post is it not […]

Read More

Disable feedback surveys in Power Platform

If you have worked in Microsoft 365 PowerApps or Power Automate, you might be familiar with feedback survey which pops up quite often. Microsoft wants your feedback on how likely are your to recommend Power Automate to a friend or colleague? Well, I ran into a conversation in twitter about this survey. Apparently I learnt […]

Read More

Missing a column in SharePoint list/library filter pane

Missing a column in SharePoint list/library filter pane? It is normal. Not all columns are available in the filter pane by default. What is filter pane? Filter pane is available in the top right hand corner in list or library page. It is available by clicking on the funnel icon. Filters available are based on […]

Read More