SharePoint's hidden user-list - User Information List

SharePoint's hidden user-list - User Information List

Update 2019: User Info List is still alive, and this post have been updated with screenshots that are based on SharePoint 2019.
Update 2016:This post was originally written in June 2008, but the User Information List still exist in the current versions of SharePoint. Enjoy.

This might not come as news to most SharePoint developers who’ve been around a while, but lately I’ve been working with the User Information List in SharePoint and it doesn’t seem that many people know that it exists.

Note: This list is only visible to and accessible by administrators.

User Information List – Background

The User Information List stores information about a user by having some metadata set up for the user. Some examples are Picture, Email, DisplayName, LoginName etc.

For a complete list of fields, see further down this blog post under "User Information List Fields".

Something to note is that when a user is granted access to a site, a new item will be created in the User Information List storing some information about the user.

When a user add/create or edit an item, SharePoint will display something like "Last modified at 1/1/2008 by Tobias Zimmergren" like the following pic:

Hidden User Information List modified and created metadata information by SharePoint system.

In this example the DisplayName (used to display System Account) is gathered from the User Information List

Browsing the User Information List

The User Information List can be accessed (Only if you’re admin) via the browser by navigating to /_catalogs/users/simple.aspx from your site. (Like this for example: https://intra.zimmergren.net/_catalogs/users/simple.aspx.

Updated 2019: This works on SharePoint 2007, SharePoint 2010, SharePoint 2013, SharePoint 2016 and SharePoint 2019.

In SharePoint 2007, navigating to the SharePoint User Information List may look like this:

SharePoint's hidden User Information List in SharePoint 2007 (WSS and MOSS).

In SharePoint 2019, it can look like this, for an updated reference:

User Information List in SharePoint 2019 - showing the users on this specific publishing site.

Write code to interact with the User Information List

If you want to interact with this list to set properties on a user (In my case, I'm doing this and I'm using WSS 3.0 at the writing of this post) you could do it like this:

// Instantiates the User Information List 
SPList userInformationList = SPContext.Current.Web.SiteUserInfoList;

// Get the current user 
SPUser user = SPContext.Current.Web.EnsureUser(@"ZIMMERGREN\TobiasZimmergren");

// The actual User Information is within this ListItem 

SPListItem userItem = userInformationList.Items.GetItemById(user.ID);

The above code will give you the SPListItem object which links to the currently logged in user (the one executing the request).

You can then work with the SPListItem object like normal to get or set the properties like this:

string pictureURL = userItem["Picture"].ToString();

User Information List Fields

Instead of writing out all the fields/columns available, you can simply create a new Console Application and insert the following code in order to output all the fields names and internal names:

Accessing the SharePoint Hidden User Information List programmatically using C#

Note: You will of course have to change the URL and User LoginName

Thank you for reading

Hope this will enlighten some of you people in your quest for the holy grail (SharePoint All-Mighty Knowledge?)

Enjoy.

About Tobias Zimmergren

Hi, I'm Tobias. I plan, architect and develop software and distributed cloud services. Nice to meet you!

Comments