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.

RecycleShare1.gif

Using SharePoint object model:

Recycle Bin Status:

RecycleShare2.gif

webApp.SecondStageRecycleBinQuota = 50;

// -------------for Off option to be enabled

webApp.SecondStageRecycleBinQuota = 0;

Update the changes:

webApp.Update();

PowerShell script: