Skip to main content

Empty the tenant recycle bin

Author: Laura Kokkarinen

Your deleted modern SharePoint sites are not going to disappear from the UI before they have been removed from the tenant recycle bin. You can either wait for three months, delete them manually via the SharePoint admin center, or run the CLI for Microsoft 365 script below.

$deletedSites = m365 spo tenant recyclebinitem list -o json | ConvertFrom-Json
$deletedSites | Format-Table Url

if ($deletedSites.Count -eq 0) { break }

Read-Host -Prompt "Press Enter to start deleting (CTRL + C to exit)"

$progress = 0
$total = $deletedSites.Count

foreach ($deletedSite in $deletedSites)
{
$progress++
Write-Host $progress / $total":" $deletedSite.Url
m365 spo tenant recyclebinitem remove -u $deletedSite.Url --force
}
CTRL + M