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

Traditionally I use:

if (web.CurrentUser.Name == "System Account")

Is there a possibility the System Account Name could be something other then "System Account". Is there a more reliable way to check if CurrentUser is the System Account?

This is using SharePoint 2010.

share|improve this question
up vote 10 down vote accepted

To check if the Current User is system account you can use

if (web.CurrentUser.ID == web.Site.SystemAccount.ID) 

SystemAccount is a property of SPSite object which gets the System Account of the site collection

share|improve this answer
SPContext.Current.Web.CurrentUser.ID == SPContext.Current.Site.SystemAccount.ID

This method is suitable?

share|improve this answer
Yes except SPContext is null for me this in this case so I had to go with the SPWeb object from the event properties to grab the CurrenUser – Meyer Denney Aug 9 '12 at 5:37

Yes actually you can.

  • Go to central administration

    1. Click on Security on the left
    2. Click on "Specify web application user policy"
    3. Click on the account you want to check on
    4. Check or uncheck the "Choose System Settings" option with "Account Operates as System"
share|improve this answer
-1 Unfortunately you appear to be answering the wrong question – Stuart Pegg Aug 9 '12 at 8:19

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.