In this article we will be seeing how to configure recycle bin settings for Sharepoint 2010 web application using object model and powershell. Microsoft SharePoint Server 2010 supports two stages of Recycle Bins.
When a user deletes an item, the item is automatically sent to the first-stage Recycle Bin. By default, when an item is deleted from the first-stage Recycle Bin, the item is sent to the second-stage Recycle Bin. A site collection administrator can restore items from the second-stage Recycle Bin. Go to Central Administration => Web Applications =>Manage Web Applications => Select the web application. In the ribbon interface go to Manage => General Settings.
Using SharePoint object model:
namespace RecycleBinSettings { class Program { static void Main(string[] args) { SPWebApplication webApp = SPWebApplication.Lookup(new Uri("https://anavijai.com/"));
// -------------SharePoint Recycle Bin Settings ------------------------------------- } } }
Recycle Bin Status:
webApp.SecondStageRecycleBinQuota = 50;
// -------------for Off option to be enabled
webApp.SecondStageRecycleBinQuota = 0;
Update the changes: webApp.Update(); PowerShell script:
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: