Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
0 like 0 dislike
2.1k views
in SharePoint Server by 40 47 56

I have a requirement to temporarily prevent all users to access a specific site collectionIs it possible to prevent access to a SharePoint site collection for all users without deleting it? I just need an option to disable site collection and prevent all users to access and browsing it even if they have permission for this site collection! How I can do that in SharePoint 2016/2019?


1 Answer

2 like 0 dislike
by 163 204 403
selected by
 
Best answer

Is it possible to disallow a SharePoint site collection to be not accessible for all users?

As a short answer: YES, you can prevent access to a specific site collection in SharePoint 2016 by managing the Site Collection Quotas and Locks in SharePoint Central Administration.

No access site collection sharepoint 2016


How to prevent access for a site collection in SharePoint Server?

To prevent users to can browse or accessing a specific site collection in SharePoint 2016, you have to configure the Site Collection Quotas and Locks in Central Administration by doing the following:

  1. Open SharePoint Central Administrator > Application Management > Site Collection > Configure quotas and locks.
    Disable site collection SharePoint 2016
  2. In Site Collection Quotas and Locks, Choose the site collection that you would like to prevent all users to access,
  3. At Site Lock Information, you have 4 options to manage the lock status for the specified site collection as following:
    • Not locked to unlock the site collection and make it available to users.
    • Adding content prevented to prevent users from adding new content to the site collection. however, updates and deletions are still allowed.
    • Read-only (blocks additions, updates, and deletions) to prevent users from adding, updating, or deleting content.
    • No access to prevent users from accessing the site collection and its content.
      Site Collection Quotas and Locks SharePoint 2016

Note: You must be a member of the Site collection Administrator for this site collection to can manage Quotes and Locks.

In your case, you have to just set the lock status to "NO ACCESS" to prevent users from accessing the site collection and its content, and in this case, the site collection will not be available with no need of deleting the site collection. however, the users who attempt to access this site receive an error message and you have to Handel it in your F5 settings.

How to lock a site collection in SharePoint using PowerShell?

  • You can also use the PowerShell to set the lock status to "NOACCESS" by running the below PowerShell Command-Line:

      Set-SPSite -Identity http://SiteCollectionURL/ -LockState NoAccess 
    
  • If you would like to allow the site collection again for all privileged users, you can run the below PowerShell Command-Line:

      Set-SPSite -Identity http://SiteCollectionURL/ -LockState Unlock 
    
  • If you would like to prevent users from adding new content however the update and delete would be still allowed, you can run the below PowerShell Command-Line:

      Set-SPSite -Identity http://SiteCollectionURL/ -LockState NoAdditions
    
  • Finally, If you would like to prevent users from adding new content, updating, and deleting, you can run the below PowerShell Command-Line:

      Set-SPSite -Identity http://SiteCollectionURL/ -LockState ReadOnly 
    

Applied To

  • SharePoint 2019
  • SharePoint 2016
  • SharePoint 2013

Check also how to Manage the lock status for site collections in SharePoint Server

by 40 47 56
0 0
Thanks a lot for this great answer!
If you don’t ask, the answer is always NO!
...