Click here to Skip to main content
15,881,424 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm updating around 100,000 sharepoint user profiles programmatically, in C#, using the UserProfileManager.

In my tests, it appears that each user profile update is taking me 0.7 seconds to finish. Is this about right? At this rate, it'll take me 17.5 hours to complete the update process.

I'm using code similar to below:
C#
using (var spSite = new SPSite(txtUrl.Text))
{
    var spContext = SPServiceContext.GetContext(spSite);
    var userProfileManager = new UserProfileManager(spContext);

    ...

    var accountName = "MyAD\\mickey.mouse"; // hard code for now
    var userProfile = userProfileManager.GetUserProfile(accountName);

    userProfile["WorkEmail"].Value = "mickey.mouse@gmail.com";

    userProfile.Commit();
}


Am I doing anything wrong? Any better way to do this?
I'm hoping I'll be able to finish the update process in a few hours only.


Thanks in advance.

Rafferty
Posted
Updated 9-Oct-11 14:47pm
v3

1 solution

Nothing wrong that I can see, you are just trying to make a massive update. What is it you are trying to update and why isn't it being handled by Profile Sync job?
 
Share this answer
 
Comments
Rafferty Uy 9-Oct-11 22:30pm    
I'm migrating data into some custom properties, so the sync job won't be able to take those in.
I'm trying to thread this out, hopefully that will improve the performance.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900