← TenantTools365Blogone .sppkg · seven tools
Undelete365 · Incident

A user deleted thousands of files from SharePoint. Here's how to get them all back (without clicking 100 at a time)

The recycle bin lets you select 100 items at once. Here is the PowerShell that restores everything one person deleted on one day, the two reasons it silently restores nothing, and the one-click alternative.

Published 2026-06-29 · by HS Services

It is usually a Monday. Someone selected a folder in File Explorer, thought they were tidying up a synced copy, and pressed Delete. Now a whole department's library is empty, the recycle bin shows 4,000 items, and the site recycle bin will let you tick 100 of them per page.

This post is the whole route: what the browser can do, the PowerShell that restores exactly what one person deleted, why that script sometimes restores nothing at all, and where a tool is worth it.

First, stop the bleeding

What the browser can do

Settings gear → Site contentsRecycle bin. Sort by Deleted so the incident sits at the top, tick the box in the header, click Restore. That restores the page you are looking at, which is 100 items. Scroll, the next 100 load, repeat.

For 300 items that is fine. For 4,000 it is forty rounds of tick, restore, wait, scroll, and the list re-sorts under you while other people's deletions land in between. Most admins give up around round six and go looking for PowerShell.

Two things worth knowing before you leave the browser:

The PowerShell that does it properly

You need PnP PowerShell and a site collection admin account. The idea is simple: list every recycle bin item, keep the ones deleted by that person in that window, restore those.

Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/Finance -Interactive

$who   = 'p.jansen@contoso.com'
$from  = Get-Date '2026-06-22 09:00'
$to    = Get-Date '2026-06-22 09:30'

Get-PnPRecycleBinItem -RowLimit 50000 |
  Where-Object { $_.DeletedByEmail -eq $who -and $_.DeletedDate -ge $from -and $_.DeletedDate -le $to } |
  Restore-PnPRecycleBinItem -Force

That is the 80% version. The checks that stop it restoring the wrong thing — showing you the list first, skipping files it should not touch, and confirming afterwards — are the part we built the tool for.

Why the script "works but restores nothing"

This is the question that comes up again and again on Microsoft Q&A: the script runs clean, no errors, and nothing comes back. Three causes cover almost every case.

  1. You are connected to the wrong site. Recycle bins are per site collection. If the files lived in a subsite or a different site than the URL you connected to, the query returns items from the wrong bin and the filter matches nothing. Check Get-PnPSite before you trust a zero.
  2. The items are in the second-stage bin. When a user (or a script) deletes from the site recycle bin, items move to the site collection recycle bin. Get-PnPRecycleBinItem returns both stages by default, but if you added -FirstStage while experimenting you will only ever see half. Use -SecondStage to check.
  3. Time zones. DeletedDate comes back in UTC. A "09:10 Monday" incident in Amsterdam is 07:10 UTC. Widen the window, or convert.

A fourth, rarer one: the account you connected with is a site owner but not a site collection admin, so it only sees its own deletions. The count will be small and wrong instead of zero.

When PowerShell is the wrong tool

That is the point where a recycle bin tool earns its price: search by name, date range, or who deleted it, see the matching list, restore it as one job. Undelete365 does exactly that inside the SharePoint page, with no PowerShell and no permissions beyond what the user already has, and it never contains a permanent-delete code path.

Afterwards

Questions people also ask

How to restore all files in the SharePoint recycle bin at once?

In the browser you can select at most 100 items per page. For more than that, use PnP PowerShell — Get-PnPRecycleBinItem piped to Restore-PnPRecycleBinItem — or a tool that filters by who deleted and when and restores in one job.

How far back does the SharePoint recycle bin go?

93 days from the moment the item was deleted from its original location, counted across both the site recycle bin and the second-stage (site collection) recycle bin. After that the item is gone unless Microsoft support can restore the whole site collection within a further 14 days.

Can you restore files deleted by a specific user in SharePoint?

Yes. Every recycle bin item records who deleted it (DeletedByEmail) and when (DeletedDate). Filter on those two fields in PowerShell, or in a recycle bin search tool, and restore only that set.

Where can I find the recycle bin in SharePoint?

Settings gear → Site contents → Recycle bin (top right). Site collection administrators also see a second-stage recycle bin link at the bottom of that page.