2-
Stop the User Profile
synchronization service
Central Administration > System Settings > Manage Services
on Server > User Profile Synchronization Service > Stop
3- You must disable My Site cleanup timer job before you
reset the synchronization database. (Otherwise, the job will delete all
user profiles and My Sites from the farm) and Disable User Profile
Incremental Synchronization timer job
Central Administration > Monitoring > Review Job
Definition > My Site Cleanup Job > Disable
Central Administration > Monitoring > Review Job
Definition > User Profile Service Application Name-User
Profile Incremental Synchronization > Disable
4- Stop the SharePoint 2013 Timer Service
SharePoint 2013 Management Shell (Run
as Administrator) > net stop sptimerv4
5- Reset the Synchronization Database
a- SharePoint 2013 Management Shell (Run as Administrator) > Get-SPDatabase
Then find
the ID of Sync DB (Default name is Sync DB).
b- SharePoint 2013 Management Shell (Run as Administrator) > Get-SPServiceApplication
Then find
the ID of User Profile Service App.
c-
Copy
the following code and paste it into a text editor and save it as ResetSyncDB.ps1
:
$syncid = “<id from step
a>”
$upaid = "<id from
step b>"
$syncdb=Get-SPDatabase $syncid
$syncdb.Unprovision()
$syncdb.Status='Offline'
$upa= Get-SPServiceApplication
$upaid
$upa.ResetSynchronizationMachine()
$upa.ResetSynchronizationDatabase()
$syncdb.Provision()
d- In SharePoint 2013 Management Shell change the directory
the where you saved the ResetSyncDB.ps1
Then type: ./ResetSyncDB.ps1
6- Start the SharePoint 2013 Timer Service:
SharePoint 2013 Management Shell (Run
as Administrator) > net start sptimerv4
7-
Start the User Profile
synchronization service
Central Administration > System Settings > Manage Services
on Server > User Profile Synchronization Service > Start
8-
Reset IIS:
SharePoint 2013 Management Shell (Run
as Administrator) > iisreset
9-
Create connections to
the data sources.
a- Open User Profile Service Application Settings
Central Administration > Application Management > Service
Application > Manage Service Application> User Profile Service
Application
b- Create New Synchronization Connection
Synchronization > Configure Synchronization Connection >
Create New Connection
10- Import Users Photos from Active Directory Into SharePoint
a- in the User Profile Service Application Page
People > Manage User Properties > Picture > Edit
b- Scroll down to the Add New Mapping section. Choose
your AD data connection, select the thumbnailPhoto attribute and click
Add, followed by OK to save the change. This maps the SharePoint picture
property to a user’s photo attribute in AD.
11- Enable My Site Cleanup Timer Job and User Profile Incremental
Synchronization timer job
a- Run two full profile
synchronizations.
b- Once the second
profile synchronization is finished, open the SharePoint
2013 Management Shell (Run as Administrator)
Update-SPProfilePhotoStore
-CreateThumbnailsForImportedPhotos 1 -MySiteHostLocation <MySiteURL>
c- After the second profile
synchronization is finished;
Central Administration > Application Management > Service
Application > Manage Service Application> User Profile Service
Application > Manage User Profiles
d-
Next to View, select Profiles Missing from
Import
e- In the Find
Profiles box, type the domain for the profiles and then click Find.
f- For each profile that
is returned, check the originating directory service, such as Active Directory,
for the status of that profile. If the status of any of the returned profiles
in the directory is not disabled or is not deleted, do not enable the My Site
cleanup timer job (Ignore next step only). Contact Microsoft support for
more assistance. Otherwise, enable the My Site cleanup timer job.
g- Enable My Site Cleanup
Job
Central Administration
> Monitoring > Review Job Definition > My Site Cleanup Job > Enable
h- Enable the User
Profile Incremental Synchronization timer job
Central Administration
> Monitoring > Review Job Definition > User Profile Service
Application Name-User Profile Incremental Synchronization > Enable
Refrences: