Scenario/Problem: You want to allow or prohibit access to the site collection.
Solution: Use the Set-SPSite
cmdlet with the LockState
parameter.
The Set-SPSite
cmdlet has several parameter sets for configuring various settings on the site collection. Running Set-SPSite
with the -?
parameter displays each parameter set. The LockState
parameter enables you to lock or unlock the site collection. The following are valid values for the LockState
parameter:
• Unlock
• NoAdditions
• ReadOnly
• NoAccess
The Unlock
state provides full availability to users (based on the normal permissions). NoAdditions
enables you to lock the site collection so that no new content can be added. This does not lock down updates or deletes. To fully lock down the content, use the ReadOnly
state. Placing the site collection into the ReadOnly
state prevents users from adding, updating, or deleting content. NoAccess
disables all access to the site collection. Users will not even be able to navigate to the site collection location (or locations underneath).
Listing 8.8 shows a sample command line for changing the lock state.
Set-SPSite -Identity http://sp2013/sites/sitecol -LockState NoAdditions
18.217.5.86