Forum Discussion

Simon Denton's avatar
Oct 31, 2017
Solved

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.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

  • Vladilen's avatar
    Vladilen
    Brass 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 Naik's avatar
      Viral Naik
      Copper 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

      • Vladilen's avatar
        Vladilen
        Brass Contributor

        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

Resources