If you need to set a site collection to read only, all you have to do is run two lines in PowerShell.
First, to verify the results, let’s look at the site when it is NOT read only:
As you can tell by the ribbon UI, you are able to select New Document, Upload Document, and New Folder. Now, let’s run the following from the SharePoint 2010 Management Shell:
$site = Get-SPSite -Identity <site url>
$site.readonly = $true
Refresh the page and notice how the previously available options are now grayed out:
Also notice that even the Add document link under the document has been removed, since you are no longer able to add documents in its read only state.
When you are ready to switch back, simply run the lines again with $false:
$site = Get-SPSite -Identity <site url>
$site.readonly = $false
06/18/2012 at 1:51 pm
This Script is sweet, here i was thinking i will have to iterate throught each site and change all permissions to read.
This has just saved me hours. Thanks Adam, u Rock
06/18/2012 at 2:05 pm
No, YOU rock for finding my site! Glad I was able to help you out. Thanks again for visiting and you are most welcome!