How to Restore Bulk SharePoint Recycle Bin Items Using PowerShell PagingInfo
Question details
The user needs to restore hundreds of thousands of deleted SharePoint documents using PowerShell because the standard recycle bin interface cannot handle the volume.

- Product
- SharePoint
- Device & OS
- not provided
- Scenario
- Attempting a bulk restoration of deleted documents from the SharePoint recycle bin using PowerShell scripting.
- Observed behavior
- The standard recycle bin UI is impractical for massive numbers of deleted items, requiring a script that utilizes PagingInfo to process the restoration in batches.
Verify your SharePoint Administrator permissions and ensure you have the latest SharePoint Online Management Shell or PnP PowerShell module installed on your system.
Restore the SharePoint Document Library to a Previous Time
The most efficient method for recovering massive amounts of recently deleted files without writing complex, paginated PowerShell scripts.
Before diving into complex PowerShell queries with PagingInfo, check if you can simply roll back the entire document library. This feature natively handles massive changes and eliminates the need for scripting.
Navigate to the specific SharePoint document library where the mass deletion occurred using your web browser.
Click the Settings gear icon in the top right corner of the SharePoint interface and select 'Restore this library'.
Choose a specific date and time from the dropdown menu that falls immediately before the mass deletion incident took place.
Review the slider showing the changes that will be undone, then click 'Restore' to revert the library to its previous state.

Utilize PowerShell and Request Scripting Assistance
If point-in-time restoration is unavailable, you must use PowerShell to query and restore recycle bin items in batches using PagingInfo.
Manage Your Local Documents Efficiently with WPS Office
While resolving complex SharePoint server issues requires administrative IT tools, managing and backing up your daily documents is much simpler with reliable desktop software. WPS Office is a lightweight, highly compatible alternative to Microsoft Office that helps you avoid data loss through powerful local auto-backup features.
- 1. Download the Installer: Visit the official WPS Office website and click the free download button for your operating system.
- 2. Install the Software: Run the downloaded installer file and follow the straightforward on-screen instructions to complete the setup.
- 3. Open Your Documents: Launch WPS Office and open your existing Microsoft Office files to edit them locally with full compatibility.

Frequently Asked Questions
Why can't I just use the SharePoint Recycle Bin interface to restore all files?
The standard SharePoint web interface is not designed to process hundreds of thousands of items simultaneously. Attempting to bulk-select and restore that volume through the browser usually results in page crashes, timeouts, or incomplete restorations.
What exactly is the PagingInfo parameter in SharePoint PowerShell?
PagingInfo is a property used by SharePoint APIs to manage massive datasets. It acts as a bookmark, telling your script where the last batch of items ended so the subsequent query can pick up exactly where it left off without overloading the server.
How long are deleted files kept in the SharePoint Recycle Bin?
By default, deleted items are retained in the SharePoint recycle bins for a total of 93 days. This duration encompasses the time spent in both the first-stage (user) and second-stage (site collection administrator) recycle bins.
Can I use 'Restore this library' for a specific folder instead of the whole library?
No, point-in-time library restoration rolls back the entire document library. If you only need to restore a specific folder's contents, you must manually recover them from the recycle bin or write a targeted PowerShell script.




