Deal with Deleted Sites that Can’t be Permenately Deleted in SharePoint Online

In SharePoint Online, deleted sites will be permanently deleted automatically after a certain period of time so normally you don’t really need to worry about it. If you need to get rid of them now so you can reuse the URL right away, you can permanently delete them right from Deleted Sites on the SharePoint Online Admin portal.

But what if the Permanently delete option is greyed out like this?

That’s because the Primary admin of the site is still set as the Group owners. You can’t purge the sites that still have any connections to the M365 groups. So, you can either restore the site and change the primary owner to an individual user and then delete it again, or better, you can take advantage of the power of PowerShell.

Install-Module -Name Microsoft.Online.SharePoint.PowerShell
Connect-SPOService -Url https://tenent-name.sharepoint.com
Remove-SPODeletedSite -Identity site_url

It works like a charm, except if you are trying it in PowerShell 7, in which you won’t be able to connect to the SharePoint Online service. Check out this to see how to get around it.

Leave a Reply

Your email address will not be published. Required fields are marked *