Over the last several days I’ve been dealing with a user synchronization issue.  We had a situation which may be fairly common in organizations where SharePoint adoption is a slow process and not always well thought out.  Specifically we had a series of sites that were early adopters before all the bells and whistles within SharePoint could be enabled.  Most notably, we had people using SharePoint before the User Profile Sync with Active Directory was enabled.  When AD sync was enabled, we noticed that there were a handful of users in the WSS User Information List for the sites that were not synchronizing with the User Profiles.

Both full and incremental profile imports were run multiple times; However, the User Information Lists appeared to remain in an unsynchronized state for a handful of accounts.  I even opened up the trusty command line and ran the stsadm –o sync to force the synchronization of the User Information List (Both Profile Synchronization & Quick Profile Synchronization jobs), but this also had no effect.  I even tried modifying the fields in AD, running the sync to update the User Profile thinking there was a change flag that needed to be set to push the Profile out to the User List.  None of the changes were applied to User Information Lists after the sync jobs were completed.

Strangely enough, running the "stsadm -o sync -listolddatabases <num days>" command, it appeared that all the sync databases were up to date within the last hour.  Normally in this situation you’ll find one or two of the databases behind in the synchronization and can run the "stsadm -o sync -deleteolddatabases <num days>" command to remove the outdated sync information.

Running the “stsadm –o sync –listolddatabases 1” produced this

User Profile Application ‘User Profile Service Application’ – Partition ‘XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX’
No databases match the criteria for this Partition in this User Profile Application

While runing the “stsadm –o sync –listolddatabases 0” command produced this:

User Profile Application ‘User Profile Service Application’ – Partition ‘0c37852b-34d0-418e-91c6-2ac25af4be5b’
ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX  Synchronized: 2/6/2012 3:00:01 PM
ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX  Synchronized: 2/6/2012 3:00:04 PM
ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX  Synchronized: 2/6/2012 3:00:03 PM
ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX  Synchronized: 2/6/2012 3:00:03 PM
ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX  Synchronized: 2/6/2012 3:00:04 PM
ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX  Synchronized: 2/6/2012 3:00:01 PM
ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX  Synchronized: 2/6/2012 3:00:01 PM
ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX  Synchronized: 2/6/2012 3:00:02 PM
ID: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX  Synchronized: 2/6/2012 3:00:01 PM

I’m not sure if there was corruption in the databases, or if it just needed a good swift kick in the pants, but I decided that since they weren’t doing what I wanted them too, might as well dump them and have SharePoint rebuild them, so I ran this:

stsadm –o sync –deleteolddatabases 0

and then

stsadm –o sync

roughly 10 minutes later after some finger crossing and wishful syncing, the accounts that were in the User Profile were now fully synced with the User Information List.  Unfortunately there’s still some cleanup work to be done in the User Information Lists for accounts belonging to employees who have since left the company and been removed from AD (and thus the User Profile was removed as well) but at least I’ve got my sync for all active accounts working again.