Clear SharePoint Site’s Recycle Bin using PowerShell Script

PowerShell : Empty SharePoint Recycle Bin

I have been in this situation where my SharePoint 2013 Recycle Bin is filled up with over 3 lakh items to delete. 

I believe only PowerShell can do this magic. And the below script took me around one hour to delete all items. 


$Site = Get-SPSite "SiteUrl"
$RootWeb = $Site.RootWeb
foreach($web in $RootWeb.Webs)
{
      $web.RecycleBin.DeleteAll();
}
$Site.RecycleBin.DeleteAll();

$Site.Dispose();


Hope you find this helpful. 

For more information on Second stage Recycle Bin, visit : SharePoint Site CleanUp

Comments

Popular posts from this blog

SharePoint Hierarchy

FIPS Compliance

SharePoint 2013 Quick Access URL List