Skip to content

[BUG] Restore-PnPRecycleBinItem: The Attempted operation is prohibited because it exceeds the list view threshhold #1598

@365gitsupport

Description

@365gitsupport

Hi

We are currently having a problem regarding recovering deleted files from the recyclebin and second stage recycle bin.

When we run the command: Get-PnPRecycleBinItem -RowLimit 200000 | ? {($.DeletedDate -gt $date2 -and $.DeletedDate -lt $date1)} | Restore-PnPRecycleBinItem -Force -RowLimit 200000

We get the error
image

We have been in contact with MS Support and they told us to restore them in a batch and that didn't help either, we got the same error code as before.

The amount of files we are restoring are around 160 000 files.

  1. Are you using Invoke-PnPSiteTemplate or Get-PnPSiteTemplate? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/pnp/pnpframework/issues.
  2. Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.
  3. If you think that the functionality might be related to the underlying libraries that the cmdlet is calling (We realize that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/pnp/powershell/tree/master/src/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/pnp/pnpframework/issues

Reporting an Issue or Missing Feature

Please confirm what it is that your reporting

It is an issue

Expected behavior

Please describe what output you expect to see from the PnP PowerShell Cmdlets

To be able to recover deleted files from the recyclebin and second stage recyclebin

Actual behavior

Please describe what you see instead. Please provide samples of output or screenshots.

We get the error The Attempted operation is prohibited because it exceeds the list view threshhold

Steps to reproduce behavior

Please include complete script or code samples in-line or linked from gists

Connect-PnPOnline -Url https://customer.sharepoint.com/ -UseWebLogin
$today = (Get-Date)
$date1 = $today.date.addDays(-77)
$date2 = $today.date.addDays(-81)
Get-PnPRecycleBinItem -RowLimit 200000 | ? {($.DeletedDate -gt $date2 -and $.DeletedDate -lt $date1)} | Restore-PnPRecycleBinItem -Force -RowLimit 200000

What is the version of the Cmdlet module you are running?

(you can retrieve this by executing Get-Module -Name "PnP.PowerShell" -ListAvailable)

image

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions