SOLVED

Possible to Set SPO-Site read only?

MVP

Will it be possible to use PowerShell to Set a SharePoint Online site as Read Only?

 

Currently the options are:

 

NoAccess and Unlock

 

https://technet.microsoft.com/en-us/library/fp161394.aspx 

 

Also has the Set-SPO lock state been resolved for Group sites (as mentioned in this article by @Drew Madelung)

 

 

 

6 Replies
best response confirmed by Simon Denton (MVP)
Solution
Ey Simon, take a look at this post: https://unnieayilliath.com/2017/07/16/sharepoint-online-set-a-site-collection-as-read-only/ Currently is the only option we have
Thanks Juan, I'll take a look!

Seems like MS implemented "ReadOnly" option for SPO.
I just was able to do "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." SPO_ReadOnly.png

 

 

 

 

@Vladilen do you know if i can turn it off ? i got one site collection restored which is read-only, so i need to know how can i turn off the read-only. Thanks

@Viral Naik 

I would run something like that:

Connect-SPOService -Url https://contoso-admin.sharepoint.com
$siteUrl = "https://contoso.sharepoint.com/sites/test01"
$site = Get-SPOSite $siteUrl -Detailed
Set-SPOSite $site -LockState Unlock

Hi @Vladilen  that worked for me, Thank you so much.

1 best response

Accepted Solutions
best response confirmed by Simon Denton (MVP)
Solution