I have deleted a list from SharePoint site (using SharePoint Designer) which contains less than 5000 items. I don't have any other lists or libraries on the site, but still, cannot remove the list from the second stage of the site's recycle bin, receiving the following error:

Some of the items you selected do not exist. They may have been deleted or restored by another user. 

Actually, my main goal is to delete the whole site, but when I try so, I receive the following error:

The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator. 

I have all necessary accesses to do anything on the site, but I cannot access SharePoint Central Administration as the farm hosted on an external service provider's server.

Could you please suggest any workaround which can solve the issue?

Thanks in advance.

1 Answer 1


Clear the second stage Recycle Bin using Powershell:

#   This script will delete items from the Second Stage Recycle Bin that
#   are older than XX days.

Add-PSSnapin Microsoft.SharePoint.PowerShell

$i = 0

#SharePoint Site Collection URL
$url = "http://mySiteURL" # Specify SITE URL here  <<<<<<<<<<<<<<<<<<<<<<<<
#$url = Read-Host "Enter a valid URL to a SharePoint Site Collection?"
#if($url -eq ""){write-host "No URL provided." -foregroundcolor Red; Exit}

#How many days ago should items be deleted from?
$deleteFrom = 2 #Delete From Last 2 days <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
#$deleteFrom = Read-Host "Remove items older than how many days?"
#if($deleteFrom -eq ""){write-host "No value provided." -foregroundcolor Red; Exit}

#Create report in script path
$scriptpath = $MyInvocation.MyCommand.Path
$dir = Split-Path $scriptpath
$report = "$($dir)\DeletedSecondStateRecycleBinItems.csv"

#Date calculations
$dateNow = Get-Date
$dateDiff = $dateNow.AddMinutes(-$deleteFrom)
#$dateDiff = $dateNow.AddDays($deleteFrom)

#Display date/times for review in table
$table = @()
$review = New-Object System.Object
$review | Add-Member -type NoteProperty -Name "Date" -Value "Timestamp now"
$review | Add-Member -type NoteProperty -Name "Value" -Value $dateNow
$table += $review
$review = New-Object System.Object
$review | Add-Member -type NoteProperty -Name "Date" -Value "Files older than"
$review | Add-Member -type NoteProperty -Name "Value" -Value $dateDiff
$table += $review
$table | Format-Table –AutoSize

#Connect to the site
$site = Get-SPsite $url

#Report file and first row
New-Item $report -type file -Force | Out-Null
Add-Content $report "Deleted Items: $($dateNow)"
Add-Content $report "Name, Title, Deleted by, Deleted date, Path, File Guid"

#Get items from the Seconday Stage Recycle Bin (SSRB) that are older than are removel period.
$items = $site.Recyclebin | where { $_.ItemState -eq "SecondStageRecycleBin" -and $_.deleteddate -le $dateDiff}
$site.Recyclebin | where { $_.ItemState -eq "SecondStageRecycleBin" -and $_.deleteddate -le $dateDiff} | Format-Table -Property Title, Web, DeletedBy, DeletedDate -Autosize -Wrap

#Confirm there are items to delete
if($items -ne $null){

    #Create prompt
    $ok = New-Object System.Management.Automation.Host.ChoiceDescription "&OK","Description."
    $cancel = New-Object System.Management.Automation.Host.ChoiceDescription "&CANCEL","Description."
    $options = [System.Management.Automation.Host.ChoiceDescription[]]($ok, $cancel)
    $title = "Confirm"; $message = "Delete items from Second Stage Recycle Bin?"
    $result = $host.ui.PromptForChoice($title, $message, $options, 1)

    switch ($result) {
            #Get items to be deleted
            $site.Recyclebin | where { $_.ItemState -eq "SecondStageRecycleBin" -and $_.deleteddate -le $dateDiff} | foreach{
                #Add entry to report
                Add-Content $report "$($_.LeafName),$($_.Title),$($_.deletedbyname),$($_.deleteddate),$($_.Dirname),$($_.Id)"

                #Delete item by ID

            write-host "$($i) items removed from Second Stage Recycle Bin."
            write-host "Cancelled by user." -foregroundcolor Red
    write-host "No files were found in the Second Stage Recycle Bin." -foregroundcolor Red


Source: Working with SharePoint’s Second Stage Recycle Bin in PowerShell

  • I suspect this won't be useful to the OP since they cannot log in to the web front end server to run server-side PowerShell.
    – Thriggle
    Commented Dec 20, 2016 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.