I have the User Profile Service Application up and running in a SharePoint 2010 farm. It is configured with two synchronization connections; one to Active Directory and a second to a backend database through BCS. About 10 user profile properties are mapped to the BCS connection. The synchronization of user profiles runs smoothly without errors - all users and their properties are imported correctly.
But there is one issue that I have so far not been able to get around. That is, when adding a new user simultaneously in Active Directory and the backend database then the user is first imported from AD without values for the properties mapped to columns in the BCS connection. These values are not imported before the second sync.
The BDC model used in the connection was created with SharePoint Designer and works without issues. The sync connection is created as a 1:1 mapping with items identified by a custom user profile property. I have also tried to identify items by AccountName.
The scenario is easy to reproduce:
- Provision the User Profile Service Application (UPSA)
- Add a synchronization connection to an OU in Active Directory
- Create a simple SQL database with the same users as in AD. The DB should at least have a column with the AccountName and a column with some added information
- Create an External Content Type with SharePoint Designer 2010 for the SQL database. Use whatever supported authentication scheme you prefer. I created and used a new Application in the Secure Store to have the sync service account (farm account) authenticate against the SQL database.
- Add a synchronization connection to the SQL database using the BDC model created with SharePoint Designer. Select 1:1 mapping and identify users by the AccountName property.
- Add a custom user profile property in the UPSA
- Map the new property to a column in the SQL database.
- Start a full synchronization of user profiles and wait for it to complete.
- Verify that the custom user profile property is missing its value from the SQL database on all imported user profiles. THIS IS THE ISSUE.
- Start a second full sync and wait for it to complete.
- The user profiles now have the correct value on the mapped profile property.
I have checked the ULS logs for errors and also used the FIM client to monitor the entire synchronization process. But have not identified any related errors so far. My conclusion for now is that the issue is by design in User Profile Synchronization service.
My question is: Is this by design or is there a solution/work-around for this issue?