Oct 31 2017 07:25 AM
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)
Oct 31 2017 07:54 AM
SolutionMar 08 2019 07:45 PM
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."
Mar 17 2019 07:04 PM
@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
Mar 19 2019 08:05 PM
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
Mar 25 2019 05:34 PM
Hi @Vladilen that worked for me, Thank you so much.
Oct 31 2017 07:54 AM
Solution