Permanently Remove a Site Collection from SharePoint Online Admin Recycle Bin

When deleting a site collection from your SharePoint Online tenant in the SharePoint Online Admin Center, by default a deleted site collection will stay in the recycle bin for 30 days. This is great as a retention policy for many reasons, but there is no easy way to then clear your recycle bin, or at least remove a site collection from the recycle bin.

This can be done using SharePoint Online PowerShell commandlets though.

Remove-SPODeletedSite

The magic comes from a simple command, Remove-SPODeleteSite, which will remove a site collection from the recycle bin.

My standard script:

1
2
3
4
5
6
7
$username = "eoverfield@"mytenant".onmicrosoft.com"
$password = "**mypassword**"
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $(convertto-securestring $Password -asplaintext -force)

Connect-SPOService -Url https://"mytenant"-admin.sharepoint.com/ -Credential $cred

Remove-SPODeletedSite -Identity https://"mytenant".sharepoint.com/sites/"deleted-site"

That is about it. Replace the username and password variables with your tenant admin account (yes, you need tenant admin access here), provide your SharePoint Admin site url and when using the Remove-SPODeletedSite command, provide the site collection url you already deleted and is not sitting in the recycle bin.

Once you run these commands, your site collection should be completely gone and the site collection url may be re-used.

Speak Your Mind

*


two + = 6