How to Make SharePoint Online Site Collection Read Only

Site Collection Read Only

I am sure in the SharePoint world you would have run across a requirement of making the entire site collection(s) read only sometime. It is very easy if that requirement happens to be in SharePoint On-premise, we just go to the Central Admin and set the selected site collection as read only from under Locks and Quotas option.

SharePoint Online Problem

But what about SharePoint Online. When I searched for it, I came across thisĀ Lock/Unlock SharePoint Online Sites in Office 365 with PowerShell.

Unfortunately, contrary to the claim, this code doesn’t seem to have been tested with SharePoint Online as we can only use either NoAccess or Unlock Lockstates there. If you try to use other LockState mentioned in the script, you will be greeted with an error message.

Workaround

But, we have to find a way around, so lets see – it’s a simple 2 step process:

Step 1: Create a new Site Policy

  • Browse the site collection as a site collection admin and go to site settings.
  • Click on “Site Policies” under Site Collection Administration

Site Policies

If Site you are using Modern Interface, Site Policies will not be visible by default. Go to Site Collection Features and Activate “Site Policy” feature.

  • It will open a new page to create a new site policy, click on “Create”

Click on Create

  • It will open another page, asking for some information about the policy
  • Type a name like “Make Read Only”, description, select the option “Do not close or delete site automatically” and check the option “The site collection will be read only when it is closed”

Create New Policy

  • After filling the details, click on OK
  • You will be redirected back to a page which will show the created policy

All Site Policies

  • This completes first part of the configuration

Step 2: Associate the Site Policy with Site

  • Now that we have a site policy in place, lets go ahead and use it. Go back to Site Settings and click on “Site Closure and Deletion” under Site Administration

Site Closure and Deletions

  • On the next page, you will see the site policy we created in previous step listed under a drop down for Site Policy. Close the site button would not be enabled currently.

Select Site Policy

  • Select the “Make Read Only” site policy from the drop down and Click OK

Select Make Read Only

  • Open the page again by clicking “Site Closure and Deletion” link from under Site Administration
  • This time you can see “Close this site now” button would be enabled

Close Site

  • Click on the button and and Whoa, you will get a message on top of the page mentioning “This site is read only at the site collection administrator’s request.”

Site Read Only

  • To remove Read Only, just click on the “Open this site” button and you are back in business!

Even though, this option comes under Site Administration, it makes all the sub sites read only too

Hope this helps šŸ™‚

Cheers,
Anupam

You may also like

16 comments

    1. That’s there in the article as well – at the end – “To remove Read Only, just click on the ā€œOpen this siteā€ button and you are back in business!”

    1. Only way to make subsites read only is to change permissions of all associated users/groups to Read.

  1. Hello,

    Does this only apply to site collections or can you close a sub site too with the same effect?

    It doesn’t seem to be working for me when i do this for a sub-site, for example the banner doesn’t show?

  2. Hi,

    Is there any way we can automate this process?
    I am looking for approach through which policy can be applied to set of site collection based on business rule.

    SPO sites

    Thanks,

    1. You need to do this for each site collection. All sub sites of any site collection will become read only when you make the site collection read only.

  3. Does it set the entire Site Collection as read only or only the site changes are made and subsites?

Leave a Reply

Your email address will not be published. Required fields are marked *