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

Does every user that belongs to a site collection or a group in that site collection, have a user.ID?

I am iterating through a list of SPFieldUserValueCollection and am comparing the SPFieldUserValue.User.ID with the SPContext.Current.Web.CurrentUser.ID and want to make sure they will compare accurately.

share|improve this question
up vote 3 down vote accepted

Yes, every user will have an ID. SPUser.ID is the integer ID of the user in the site collection. However, the ID is specific only to that specific site collection.

I would recommend using SPUser.LoginName instead.

share|improve this answer

SPUser.ID only refers to the Item ID of their entry in that site collection's User Information List, so it's never guaranteed to be unique across a farm.

share|improve this answer
I understand it might not be unique across farms, but do you know if ever user in that farm will have an ID regardless if they are a member of the farm or just member of a group that belongs to the farm? – Meyer Denney Jun 7 '11 at 23:04
I would clarify that it isn't even unique across site collections. – Kit Menke Jun 7 '11 at 23:53
@Kit yeah, that's what I meant, though I guess how I wrote it could infer that I meant that it could be unique within a web app. Which it isn't. :) – James Love Jun 8 '11 at 7:15

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.