Hi everyone,
We have a custom feature that allows users to update her profile picture in SharePoint 2010.
The Picture property in "User Profile Service Application" is configured for export to AD when we do a Profile Synchronization.
First time when an user changes his photo in SharePoint, then we do an Incremental Sync, the new photo appears in AD. OK.
But next time we do the same scenario with the same user, the change not appears in AD. SharePoint does not detect there is a change ?? With a Full Sync, no problem, the change appears in AD.
The problem affects all users.
(When we change photo many times via Edit Profile in Central Admin, then do an Incremental Sync, we don't have the problem).
So I conclude that I don't do the update in good way. Here his my code:
SPServiceContext serverContext = SPServiceContext.GetContext(site); UserProfileManager userProfileManager = new UserProfileManager(serverContext); UserProfile userProfile = userProfileManager.GetUserProfile(accountName); userProfile["PictureUrl"].Value = "new_pictureUrl"; userProfile.Commit();
Can you help me ?
Thanks.