Making a site read-only (also known lock) is required most of the time when you are going to migrate to newer version and restrict user for any modifications. This is most of the time required over cut over migration.

If you have to lock a web application read-only which contain multiple site collections then you have to mark each of them read-only.

There are four options for changing lock status of a site collection

  • Read Only
  • Not Locked
  • Adding Content Prevented
  • No Access

Check this link for more details on locking options

There are multiple ways to lock a site collection.

  1. Using SharePoint Central Admin
  2. Using PowerShell
  3. Using STSADM

Using SharePoint Central Admin

This is the easiest way to lock/unlock a site collection. Go to SharePoint Central Admin –> Application Management –> Site Collections –> and click on Configure Quotas and Locks

Configure Quotas and Locks

This will take you to the configure Quotas and lock page, change the site collection which you want to lock or unlock.

Configure Quotas and Locks - SharePoint 2010

You can see four different options, select read-only if you want lock the site collection or select Not locked to unlock the site collection.

The above screenshots are from a SharePoint 2010 Farm, you can follow the similar steps to lock/ unlock sites on SharePoint 2007, SharePoint 2013 and SharePoint 2016.

SharePoint 2007

Configure Quotas and Locks - SharePoint 2007

SharePoint 2016

Configure Quotas and Locks - SharePoint 2016

Using PowerShell

You have seen four different options in above screenshots for different lock status. Below are the four PowerShell cmdlets to execute the similar functionality, this way is faster for SharePoint admins instead of going through central admin.

  • Set-SPSite -Identity “http://sp2010/sites/site1” -LockState “ReadOnly”
  • Set-SPSite -Identity “http:// sp2010/sites/site1” -LockState “Unlock”
  • Set-SPSite -Identity “http:// sp2010/sites/site1” -LockState “NoAdditions”
  • Set-SPSite -Identity “http:// sp2010/sites/site1” -LockState “NoAccess”

Using STSADM

I would recommend to using PowerShell cmdlets for locking / unlocking a site collection but if you are using SharePoint 2007 or WSS 3.0 (or older version) then you still use the central admin or can use below cmdlets

  • Get site lock status: stsadm -o getsitelock -url http://sp2007
  • Lock site: stsadm -o setsitelock -url http://sp2007-lock noaccess
  • Remove site lock: stsadm -o setsitelock -url http://sp2007 -lock none

Adnan, a distinguished professional, boasts an impressive track record as a Microsoft MVP, having achieved this prestigious recognition for the eighth consecutive year since 2015. With an extensive career spanning over 18 years, Adnan has honed his expertise in various domains, notably excelling in SharePoint, Microsoft 365, Microsoft Teams, the .Net Platform, and Microsoft BI. Presently, he holds the esteemed position of Senior Microsoft Consultant at Olive + Goose. Notably, Adnan served as the MCT Regional Lead for the Pakistan Chapter from 2012 to 2017, showcasing his leadership and commitment to fostering growth within the tech community. His journey in the realm of SharePoint spans 14 years, during which he has undertaken diverse projects involving both intranet and internet solutions for both private and government sectors. His impact has transcended geographical boundaries, leaving a mark on projects in the United States and the Gulf region, often collaborating with Fortune 500 companies. Beyond his roles, Adnan is a dedicated educator, sharing his insights and knowledge as a trainer. He also passionately advocates for technology, frequently engaging with the community through speaking engagements in various forums. His multifaceted contributions exemplify his dedication to the tech field and his role in driving its evolution.

Leave a Reply