Forum Discussion
Simon Denton
Oct 31, 2017MVP
Possible to Set SPO-Site read only?
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.co...
- Oct 31, 2017Ey 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
Vladilen
Mar 08, 2019Brass Contributor
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."
- Viral NaikMar 17, 2019Copper Contributor
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
- VladilenMar 19, 2019Brass Contributor
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- Viral NaikMar 25, 2019Copper Contributor
Hi Vladilen that worked for me, Thank you so much.