SharePoint consists of two out-of-the-box timer jobs which run as per below schedule and synchronize the data between Active Directory and SharePoint User Profiles:
1) Profile
Synchronization: This timer job runs every hour and does full updates.
2) Quick Profile
Synchronization: This timer job runs every couple of minute and does incremental updates.
But If synchronization doesn't happen due to some reason, there will be mismatch in the data between AD and User Profiles. To fix this issue, first we need to delete the out of sync data. After deleting the out of sync data, these timer jobs will
automatically updates User Profiles from AD.
SharePoint provides couple of stsadm commands which you can run to fix this issue.
1) stsadm -o sync
-listolddatabases <n>: This command displays the out of sync databases that have not been synchronized successfully since last <n>
days.
2) stsadm -o sync
-deleteolddatabases <n>:
This command deletes the out of sync data from the databases that are not synchronized successfully since last <n> days.
3) stsadm -o sync: This command runs SharePoint's OOTB Profile
Synchronization timer job which synchronize data between AD and User Profiles.
The above commands are applicable for both MOSS 2007 and SharePoint 2010.