Monday, August 21, 2017

How to lock a SharePoint site collection

By locking the SharePoint site collection, you can prevent it from updating contents or accessing contents. You would need this locking, when you migrate a SharePoint in to different version or in special case when a site collection is out of its storage limits.

Mainly, there 4 locking options are available.
  • Not Locked -   This is used to unlock the locked site collection.
  • Adding content prevented -   This is used to block the adding content but updating & deleting are allowed.
  • No access -   This is used to block the accessing contents of the site collection
  • Read-only -   This is used to block adding, updating & deleting contents but, accessing contents is allowed.

Furthermore you can lock a SharePoint site collection in 3 ways.
  1. By using SharePoint Central Administration
  2. By using SharePoint management shell

By using SharePoint Central Administration





By using SharePoint management shell

  1. First open the SharePoint Management shell as Administrator.
  2. Enter bellow shown command with relevant parameters and press ENTER.
         Set-SPSite -Identity "SiteCollection" -LockState "State"

Eg :- 
         Set-SPSite -Identity "http://SitecollectionName" -LockState "ReadOnly"

         Identity - It is the URL of the site collection, you are going to lock.
         LockState - This is the lock state.


Keep sharing the knowledge! :)