SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working with retrieving user info programmatically in WSS 3.0. I understand that users are stored in each Site Collection's User Information List. Deleted users are not visible in the User Information List on the people.aspx page. However, if you delete a user and add them again, they will take on the same ID as they had before. Where are these records stored?

share|improve this question
up vote 1 down vote accepted

You can pull deleted users from the SiteUserInfoList like this:

SPList myList = SPContext.Current.Web.SiteUserInfoList;

SPQuery query = new SPQuery { Query = "<Where><Eq><FieldRef Name='Deleted' /><Value Type='Boolean'>1</Value></Eq></Where>"};
SPListItemCollection entries = myList.GetItems(query);
if (entries == null || entries.Count == 0)
    throw new Exception("Users Not Found!");

You can query several other user properties as well. Details can be found at another of my answers here:

share|improve this answer
Yes, my query works ONLY when I include the "<FieldRef Name='Deleted' />" tag. A query for any other field(s) will not include deleted users. Next question: Is there a way to (a) restore or (b) delete for good any of these "deleted" users? The Delete() function throws an error, and changing the "Deleted" field does not throw an error, but has no effect. – CigarDoug Mar 6 '12 at 18:36
Posted the really, truly, actually deleting a deleted user question as a new question: – CigarDoug Mar 7 '12 at 14:21

In the SharePoint Content Database, under the Table "UserInfo". It is not supported to write the database directly.

share|improve this answer
Short of querying the Content Database directly, is there a way to access "UserInfo" from, say, the SharePoint Object Model? – CigarDoug Mar 5 '12 at 18:26
Yes, see. – Trevor Seward Mar 5 '12 at 18:34

Your Answer


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.