My user profiles have some custom properties. Now I need to get a list of all values that this custom property has on any user. This code return an error that "Column 'Division' does not exist. It may have been deleted by another user".

Is this the right approach? There is many users and possible many distinct values.

 SPListItemCollection userInformationList = SPContext.Current.Web.SiteUserInfoList.Items;
  var divisions= (from SPListItem userItem in userInformationList.Items where userItem["Division"] != null select userItem["Division"]); 

2 Answers 2


Check the GetUserProfile from UserProfileManager. You get the whole object, should be the right spot to search for a list of all custom properties..

i'm working on an almost simliar webpart.. im trying to display only a couple of custom properties..

hope to help



First of all never ever use LINQ in this way in SharePoint! You will retrieve the full user information list from the database when hitting the .Items property! Instead use a CAML query to "search" for the users using the SPQuery object.

I would recommend that you use the U2U CAML Query builder to build your query - using that tool you will get the correct columns and column name.

  • thanks for the input. I've installed it, but here my custom properties is not selectable in list. Is there any way I can provision theese custom properties to UserInformationList?
    – Jorid
    Commented Aug 3, 2011 at 10:21
  • Are we talking about custom user profile properties (added in the User Profile Service) or is it custom columns to the user info list? If it's User Profile properties, then you can't do it this way - you need to look into search or similar. Commented Aug 3, 2011 at 10:39
  • It's User Profile properties
    – Jorid
    Commented Aug 3, 2011 at 10:51
  • could you point me in any direction? where can I start?
    – Jorid
    Commented Aug 3, 2011 at 11:29
  • See Peters answer. Although it will invoke traversing all user profiles - which of course can take a looong time... You can also configure the property to use values from the Managed Metadata Store - then it's easy to get all unique values using just the MMS API's. Commented Aug 3, 2011 at 13:15

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.