I want to disable list throttling through code so i have written the following code

SPList lstBookings = web.Lists.TryGetList("Bookings");
                    lstBookings.EnableThrottling = false;

But does this requires the code to be running under elevated privileges, because if i login as a non admin user it gives me an error cannot login.

Anyone any ideas?


  • RunWithElevatedPriviledges doesnot solve this problem?
    – variable
    Jul 24, 2014 at 11:11

2 Answers 2


EnableThrottling seems to require Farm Administrator privileges. Take a look at the following code:

public bool EnableThrottling
    get { ... }
        bool nothrottlevalue = !value;

internal void SetListNoThrottle(bool nothrottlevalue)
    SPSite site = this.ParentWeb.Site;
    if (!site.WebApplication.Farm.CurrentUserIsAdministrator(true))
        SPGlobal.HandleUnauthorizedAccessException(new UnauthorizedAccessException());
        { ... }

The system account, in turn, has Site Collection Administrator privilege. The SPSecurity.RunWithElevatedPrivileges allows to run code under the Application Pool identity, which has same Site Collection Administrator privileges on all site collections.


Run this piece of code as the Application Pool identity user:

SPSecurity.RunWithElevatedPriveleges( () => {
     using (var site = new SPSite(SPContext.Current.Site.ID))
                    var web = site.RootWeb;
                    var lstBookings = web.Lists.TryGetList("Bookings");
                    lstBookings.EnableThrottling = false;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.