How to make a Site Collection Read-Only in SharePoint 2013

We can make “Site Collection” Read-Only in three ways

1. Central Administration by Administrator
2. PowerShell by Administrator
3. Server Object Model by Developer

Let us explore all the three ways.
Central Administration by Administrator

Go to Central Administration and select Application Management -> Configure quotas and locks”.
The Page will appears, choose the site collection and select the option “Read-Only”.

Note: Choose whether you want this to be farm administrator controlled or site collection administrator controlled.
Enter the lock information and click “Ok”

PowerShell by Administrator:
Now we try using PowerShell. Open SharePoint Management Shell. Enter following command for lock the Site Collection by Site URL

Set-SPSite -Identity “” -LockState “”
Example:
Set-SPSite –Identity “http://c4968397007”–LockState “ReadOnly”

Unlocking
We have to unlock the site collection, enter following command for unlock the Site Collection by Site URL

Set-SPSite –Identity “http://c4968397007”–LockState “Unlock”

Server Object Model by Developer
Crete new console application-> add reference to the Microsoft. SharePoint assembly and execute the following code.

SPSite site = new SPSite(“http://c4968397007”);
Site.ReadOnly = true;

Now the site collection is now read-only.

Note: There are three lock Options
1) Read-Only to prevent users from adding, updating, or deleting content.
2) Adding content prevented to prevent users from adding new content.
3) No Access to prevent users from accessing the site collection and its content.

Advertisements

Author: "Sharepoint Thoughts"

I’m a Microsoft Certified IT Professional with 5+ Years Experience on SharePoint Technologies. Worked extensively on “SharePoint 2007”, “SharePoint 2010”, “SharePoint 2013” & “SharePoint 2016” on Implementation, Configuration & Troubleshooting several Projects.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s