In this SharePoint 2016 tutorial, we will discuss how we can make SharePoint site to readonly using PowerShell, through the browser and from sql server database. It will help you out on making your SharePoint sites read only which is mostly required during your SharePoint migration.
These steps have been tested on SharePoint 2016, SharePoint 2013, and SharePoint 2010 also We have 3 options and we will cover each one. So, let’s get started.
We can make the SharePoint site read only by following any of the below approaches:
- From SharePoint 2016 Central Administration
- From SQL Server Database
- By using PowerShell
Steps to make SharePoint site read-only.
Make SharePoint 2016 Site Read Only From Central Administration
1. Go to Central Admin > Application Management > Configure quota and locks
2. Select the site collection which should be read-only and select the “Read Only”. Click OK
3. Now browse the site collection and we can see on the top a message that says, “This site is read only at the farm administrator’s request”
4. Go to any document library or list. Option like New document, Upload document, New Folder, Edit document, Check out or in, Delete document or edit properties will be disabled. The user can only view the document or download a copy of it.
Make SharePoint 2016 Site Read Only from SQL Server Database
1. Select the content database and go to properties.
2. Click on Option on left hand side of the window and under state change “Database read only” to “True”
3. Now the content database is in read only mode.
4. Now browse any site collection which exists in that content database and we can see on the top a message that says, “We apologize for any inconvenience but we’ve made the site read only while we are making some improvements”
5. Go to any document library or list. Option like New document, Upload document, New Folder, edit document, check out or in, delete document or edit properties will be disabled. The users can only view the document or download a copy of it.
Make SharePoint 2016 Site Read Only PowerShell
Below is the PowerShell to make the SharePoint 2016 site read-only.
Add-PSSnapin “Microsoft.sharepoint.powershell”
# Get the Web Application
$WebApp=Get-SPWebApplication “https://mySiteURL.com”
#Loop through all site collections and Set read only status
foreach ($SPsite in $webApp.Sites){
$SPsite.ReadOnly = $true #Or you can use: Set-SPSiteAdministration -LockState “Unlock” -Identity $SPsite.url
}
This is how we can make a SharePoint 2016 site read only.
You may like following SharePoint 2016 tutorials:
- SharePoint 2016 installation errors
- Self-Service Site Collection in SharePoint 2013/2016
- User profile synchronization service stuck on starting SharePoint 2013/2016
- PowerShell to clean up user information in SharePoint 2013/2016
- Working with file modification time and date using PowerShell
I am a Microsoft Certified IT Professional with 5+ years of Experience on SharePoint Technologies . Working on SharePoint online, SharePoint 2016,SharePoint 2013, SharePoint 2010 and MOSS 2007 Implementation and administration and deployed several projects.