Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

we have custom fields like e.g. Manager, Organisation, EmployeeCode. currently we are creating a custom list to add these with respective SpUser.ID, which i think is wrong.

Can any one please guide me how to add these column such that they are accessible from SPUser object ?

Many thanks in advance ...

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Salman,

If I recall correctly, you cannot use SPUser to directly access extended properties. However, the User Information List (UIL) is just a regular list, almost like any other, so the user data of an SPUser is also exposed as a regular SPListItem object. If you add columns to the UIL you can access the extended properties through the associated SPListItem.

Here's a brief article I wrote a few years back that shows how: http://blog.furuknap.net/sharepoint-user-information-list-extensions

.b

share|improve this answer
add comment

Are you using SharePoint foundation or Server? Do you have the user profile service application provisioned?

When you use profiles the extra information is stored against the user profile object. You can define custom properties against the profiles and you have a profile object per user.

If on foundation or server without user profiles then all the user info is stored in a hidden user information list, theoretically you could add fields to this list and access the data although I am not sure how supported this would be.

See this blog post for more info on that list:-

http://zimmergren.net/technical/sharepoints-hidden-user-list-user-information-list

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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