In this SharePoint Training video, we’ll tell you everything you need to know about the recycle bins in SharePoint. We’ll discuss the first and second-stage recycle bins, the deleted site recycle bin (in the SharePoint Admin center), and we’ll also show you how to delete or restore sites and files using PnP PowerShell.
PSST, HEY, YOU
(YEAH, YOU!)
Want in on insightful videos, the latest tech developments, and epic exclusive content? Get all this and more as a member of our mailing list.
Resources
Install PnP PowerShell:
Install-Module -Name "PnP.PowerShell" -RequiredVersion 1.12.0 -Force
Note: there is a newer PnP Version – 2.1.1
Import PnP PowerShell:
Import-Module PnP.PowerShell
Connect to SharePoint:
Connect-PnPOnline -url https://tenant-admin.sharepoint.com -Interactive
Clear Recycle Bin:
Clear-PnPRecycleBinItem -All -Force
Restore all items in the Recycle Bin:
Get-PnPRecycleBinItem -RowLimit 10000 | Restore-PnPRecycleBinItem -Force
View deleted sites:
Get-PnPTenantRecycleBinItem
Restore deleted site:
Restore-PnPTenantRecycleBinItem -url https://... -Force
Permanently delete a site (From the Recycle Bin):
Remove-PnPTenantSite -url https://... -FromRecycleBin -Force
Permanently delete a site (Skip the Recycle Bin):
Remove-PnPTenantSite -url https://... -SkipRecycleBin -Force