Learn more about SQL Server tools

mssqltips logo
 

Tutorials          DBA          Dev          BI          Career          Categories          Webcasts          Whitepapers          Today's Tip          Join

Tutorials      DBA      Dev      BI      Categories      Webcasts

DBA    Dev    BI    Categories

Next Webcast - Simple SQL Server Reporting - Click Here to Register
 

How to prevent SharePoint 2010 users from adding content to a site collection on a temporary basis


By:   |   Read Comments   |   Related Tips: > Sharepoint

Problem

The Enterprise has embraced SharePoint technology and generates a large amount of data on the server. As disk space is consumed, at times, content size might exceed the maximum storage limit of a site collection. At such time when any user attempts to create/upload the content, there are probable chances of loss of data.

Solution

For such a scenario, SharePoint provides Locks which would prevent all users to make any kind of additions to the site collection. Not only that, but with proper privileges one could prevent users to change the content or even can prevent access to all users of the site collection. For our scenario, we would prevent all the users to add content to the site.

To do so in SharePoint 2010, open SharePoint Central Administration. Click on Application Management.

site actions

Click on "Configure quotas and locks".

site collections

Choose the appropriate Site Collection. For achieving our purpose, select "Adding Content Prevented" which would not allow any user to add content to the site collection.

adding content prevented

Choose OK.

The SharePoint Administrator can also use Windows Powershell as follows:

Go to Start menu -> All Programs -> Microsoft SharePoint 2010 Products -> SharePoint 2010 Management Shell.

At the command prompt type...

Set-SPSite -Identity "<SiteCollection>" -LockState "<State>"

...where <SiteCollection> will be the url of site collection and <State> will be one from Unlock, NoAdditions, ReadOnly and NoAccess.

Now try to add content to the site collection and you would face the below error.

error

We can respectively change the values of the locks depending upon the requirement.

Next Steps
  • Use Locks to prevent all users from any kind of changes to the site collection.
  • Use Locks event to prevent all users to access site collection at times like migration of servers, changing site hierarchy, performing backups, system upgrade and others.


Last Update:


next webcast button


next tip button



About the author
MSSQLTips author Rahul Mehta Rahul Mehta is a Project Architect/Lead working at Tata Consultancy Services focusing on ECM.

View all my tips





Post a comment or let the author know this tip helped.

All comments are reviewed, so stay on subject or we may delete your comment. Note: your email address is not published. Required fields are marked with an asterisk (*).

*Name    *Email    Email me updates 


Signup for our newsletter
 I agree by submitting my data to receive communications, account updates and/or special offers about SQL Server from MSSQLTips and/or its Sponsors. I have read the privacy statement and understand I may unsubscribe at any time.



    



Learn more about SQL Server tools