We have some 30,000 user profiles . We'd like to build a custom list with lookup for Department from a unique list of departments in our User profiles.


Was thinking of buildin a new nightly interface to extract (using .NET and SP Object model) all departments and load unique departments into a new table.

Any easier way?


3 Answers 3


Unfortunately the only "official" way to get that information is to cycle through every user profile to get the information and write to a custom database or SharePoint list. The object model surrounding the user profiles is not very useful for collecting large amounts of information and you should not query the profile database directly in SQL.


The UserProfileManager class allows you to retrieve all the information from the AD users in SharePoint - http://msdn.microsoft.com/en-us/library/ms519160(v=office.12).aspx This could be moved to a custom list within the site.

Then create a custom timer job in the Farm to deploy the logic and schedule the job to run daily. http://dotnetfinder.wordpress.com/2010/07/24/creatingcustomsharepointtimerjob2010/


You might want to consider using script on the EditProfile page to augment the Department column. You can then store the values virtually anywhere and either read them from a list with SharePoint's Web Services (see my SPServices jQuery library) or using AJAX from another source.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.