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

When I'm try to get current logged user name for account domain\username and I added many users to this option "Account operates as System" In code I got the system account not the real name of user "Domain\username" and i want the real name and real Id for this used to difference between users all of them are with option "Account operates as System" The code I used :



share|improve this question
up vote 6 down vote accepted

You can try this if I understand you correct?






hope this helps :)

share|improve this answer
its give me the name ok but how to get the id of this user – FarOoOosa Aug 14 '12 at 10:13
iv just changed the post, lol forgot to add the ID part ;) – ali Sharepoint Aug 14 '12 at 10:16
SPContext.Current.Web.CurrentUser.ID or .Name not works for me that what I was use – FarOoOosa Aug 14 '12 at 10:37
HttpContext.Current.User.Identity.Name get the name as I want thanks – FarOoOosa Aug 14 '12 at 10:37

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.