Delete a site collection from SharePoint Online

Do you need to delete a site collection from SharePoint online?

Do you want to re-create it afterwards?

You’ll need to delete it, then remove it from the recyclebin, but you can’t do that from the gui.

Using Powershell,

1) connect to your SPO admin tenant.

2) Get a list of your deleted sites in the site collection recycle bin with:

get-spodeletedsite

Now create a statement to get just the one you want:

get-spodeletedsite | Where {$_.url -eq "https://tenant.sharepoint.com/sites/sitecollection"}

Does that return just one?

If so,  hit the up arrow on your keyboard, then the end key, now add some text until your line looks like this:

get-spodeletedsite | where {$_.url -eq "https://tenant.sharepoint.com/sites/sitecollection"} | Remove-SPODeletedSite

 

 

 

Leave a Reply