Question

Is there anyway to make the Office 365 Site Collection as Read-only mode?

Please help me by providing your valuable reply.

Was it helpful?

Solution

I think this is not supported in SharePoint Online (http://community.office365.com/en-us/f/154/t/223877.aspx).

I would suggest you remove the permission of users by adding them into Reader Groups.

Or temporarily change group permission to Read Only.

OTHER TIPS

you can lock a site using the Powershell or CSOM approach. Their is one command(Set-SPOSite) in SharePoint Online which set the lockstatus to the site collection.

Sets the lock state on a site. Valid values are: NoAccess and Unlock. When the lock state of a site is NoAccess, all traffic to the site will be blocked. If parameter NoAccessRedirectUrl in the Set-SPOTenant cmdlet is set, traffic to sites that have a lock state NoAccess will be redirected to that URL. If parameter NoAccessRedirectUrl is not set, a 403 error will be returned.

PowerShell:

Set-SPOSite https://[tenant].sharepoint.com/sites/targetsite -LockState [NoAccess|Unlock]

CSOM To do this in CSOM, you can utilize the TenantAdministration API; however, this is only available in the v16 SharePoint Online API.

using (var clientContext = new ClientContext(tenantUrl)) {
    clientContext.Credentials = spoCredentials;
    var tenant = new Tenant(clientContext);
    var siteProperties = tenant.GetSitePropertiesByUrl(siteUrl, true);
    clientContext.Load(siteProperties);
    clientContext.ExecuteQuery();

    Console.WriteLine("LockState: {0}", siteProperties.LockState);

    siteProperties.LockState = "Unlock";
    siteProperties.Update();
    clientContext.ExecuteQuery();
}

When the site is locked, you'll see it in the admin site with a lock icon next to it as seen below.

enter image description here

Source: How to change the lock state via CSOM

To set a SharePoint online site into read only mode use the site policy feature. Create a policy with the configuration showed: enter image description here

Switch to site closure and deletion option within the site settings and close the site with the read only policy

enter image description here

You should see a warning text panel at the top of the site

Seems like MS implemented "ReadOnly" option for SPO. Although it is not documented yet. But I just was able to do powershell "Set-SPOSite $site -LockState Readonly". And get

PS C:\Users\Vlad> $site | select Title, Status, LockState | fl
Title : test01
Status : Active
LockState : ReadOnly

and well-known red "This site is read only at the farm administrator's request." Read-Only for SPO

I can confirm that Vladilen's answer works with SharePoint online now, and with the SharePoint portion attached to an O365 group (file store as well as site).

I would have replied to his answer but I just created this account and don't have a high enough reputation yet to comment or upvote.

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top