Advertisement
We can make “Site Collection” Read-Only in three ways
1.
Central Administration by Administrator
2.
PowerShell by Administrator
3.
Server Object Model by Developer
Central Administration by Administrator
Go to Central Administration
and select Application Management -> Configure
quotas and locks”.
The Page will appears, choose the site collection and select the
option “Read-Only”.
Note: Choose whether you want this to be farm administrator controlled or site collection administrator controlled.
Enter the lock information and click “Ok”
PowerShell by Administrator
Now we try using PowerShell.
Open SharePoint Management Shell. Enter following command for lock
the Site Collection by Site URL
Set-SPSite
-Identity "<SiteCollection>" -LockState
"<State>"
Example:
Set-SPSite –Identity “http://c4968397007”–LockState
“ReadOnly”
Unlocking
We have to unlock the site
collection, enter following command for unlock the Site Collection by Site URL
Set-SPSite –Identity “http://c4968397007”–LockState
“Unlock”
Server Object Model by Developer
Crete new console application-> add
reference to the Microsoft. SharePoint assembly and execute the following code.
SPSite site = new
SPSite(“http://c4968397007”);
Site.ReadOnly =
true;
Now the site collection is now read-only.
Note: There are three lock Options
1) Read-Only to prevent users from adding, updating, or deleting
content.
2) Adding content prevented to prevent users from adding new
content.
3) No Access to prevent users from accessing the site collection
and its content.
Reference:
Thanks so much! Your instructions are very clear and helpful. I've been wondering how to do this for months and thrilled to find out how finally! sharepoint administrator training online
ReplyDeleteI have an urgent question. Whenever I am doing read only using powershell, it does it but it's always farm admin controlled. I want site collection admin controlled read only by running through powershell. How to do it?
ReplyDeleteThis article will help the internet viewers for building up new web site or even a blog from start to end. Useful source: How To Learn To Password Protect Folder In 1 Hour
ReplyDelete