Skip to content

Instantly share code, notes, and snippets.

@itpresso
itpresso / SharePointSecondStageRecycleBin.ps1
Created May 12, 2025 15:11 — forked from jcallaghan/SharePointSecondStageRecycleBin.ps1
This script will delete items from the Second Stage Recycle Bin that are older than XX days. See https://jcallaghan.com/2014/04/working-with-sharepoints-second-stage-recycle-bin-in-powershell/ for more information. #Website
Add-PSSnapin Microsoft.SharePoint.PowerShell
#Variables
$i = 0
#SharePoint Site Collection URL
$url = "https://sharepoint.jcallaghan.com"
#$url = Read-Host "Enter a valid URL to a SharePoint Site Collection?"
#if($url -eq ""){write-host "No URL provided." -foregroundcolor Red; Exit}