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

Is it possible to check if the current account is a SharePoint administrator? The only way I can think of achieving this is by attempting to login to the and check if I get a 403.

I thought there might be a cleaner way of doing this? This if for SharePoint Online/Office 365

share|improve this question
up vote 3 down vote accepted

Try this:

using (var ctx = new ClientContext(webUri))
    var currentUser = ctx.Web.CurrentUser;

share|improve this answer
what would I use for the webUri, to use the clientcontext would I not neet to authenticate against -admin.sharepoint url which would throw a 403 erro? – Webfort Mar 7 at 10:41
use your https://<domainname> url as webUri – Dikesh Gandhi Mar 7 at 10:57
Thanks, that looks like it works with the testing I have done. – Webfort Mar 7 at 11:19


Use the below rest api to determine the current loggin user is site collection admin or not


This returns the true or false value in xml format.

JS Format: Use the below SharePoint ecmaScript to identify the current user admin status,

function checkUserisSiteAdmin() {
    var clientContext = new SP.ClientContext();
    oUser = clientContext.get_web().get_currentUser();

        Function.createDelegate(this, function() {
            var userInfo = '';
            userInfo +='LoginName: '+ oUser.get_loginName() +', SiteAdmin: '+ oUser.get_isSiteAdmin();            
        Function.createDelegate(this, function(sender, args) {           
            alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
ExecuteOrDelayUntilScriptLoaded(checkUserisSiteAdmin, "sp.js");
share|improve this answer

In CSOM, you can execute the following line of code:



share|improve this answer

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.