Add/Remove Read-Only locks in SharePoint via PowerShell

What is read only lock on a site collection?
Read only locks prevents users from adding, updating, or deleting content on a site collection. If a user attempted to add, update, or delete content on a read only locked site collection the user would receive an error message that says that access is denied and that the user does not have permission to perform the action.

You can apply a read only lock with the below command in SharePoint PowerShell

$siteUrl = “http://SharePoint/SiteCollection”
set-spsite $siteUrl -LockState ReadOnly

To remove the lock you just need to adjust the lockstate to Unlock

$siteUrl = “http://SharePoint/SiteCollection”
set-spsite $siteUrl -LockState Unlock

About the author