fbpx

In SharePoint 2010 there is a recycle bin property called “RecycleBinRetentionPeriod”. This property specifies the number of days files will be stored in recycle bin and then will be deleted after that period.

I wrote a PowerShell script to set the SharePoint 2010 site retention period without much hassle.

$siteUrl = "http://eblogin.com"
Write-Host "Connecting to the site"
$SPSite = Get-SPSite | Where-Object {$_.Url -eq $siteUrl}
if($SPSite -ne $null)
{
$SPSite.WebApplication.RecycleBinEnabled = $true
$SPSite.WebApplication.RecycleBinRetentionPeriod = 20
$SPSite.WebApplication.Update()
}
$SPSite.Dispose()

Hope this will help.

About Us

Follow Us

Email: contact@keapoint.com
Phone:  0208 7852 888

Registered Address: 1 Amber Close, Reading, RG6 7ED. United Kingdom

Company No. 11586817