Question

I'm unable to remove site collections that were provisioned alongside an Office 365 group.

I tried two approaches.

  1. I deleted the O365 group in the O365 Admin Center. The group is gone but the opening the site collection produces a 403 forbidden error

  2. Used Remove-PnPUnifiedGroup to remove the O365 group. This was also successful. However, I'm unable to delete the SC getting the same error message. I can't even connect to the site collection in question with Connect-PnPOnline (403 forbidden)

Using Remove-SPOSite gives a slightly different error message (Access to this Web site has been blocked).

Any ideas how I can remove those leftover site

Thanks in advance for your reply.

Était-ce utile?

La solution

The solution for the 403 error was to unlock the site collection.

Set-SPOSite -Identity <URL> -LockState unlock

After that the site collection could be removed with

Remove-SPOSite

Autres conseils

In the Office 365 admin center, when you delete a SharePoint Online site collection, it is moved to the SharePoint Site Collection Recycle Bin where it will remain and can be restored for the next 30 days. To permanently delete a SharePoint Online site collection and all of its subsites without the use of the Recycle Bin, you need to use PowerShell. This scenario shows you how to immediately and permanently delete a SharePoint Online site collection.

To begin, you must connect to SharePoint Online. See Connect to SharePoint Online PowerShell for instructions.

To immediately and permanently delete a site collection, fill in the site collection's URL between the double-quotes, removing the instruction text and the < and > characters.

$siteCollURL="<URL of the SharePoint Online site collection>"
Remove-SPOSite -Identity $siteCollURL -NoWait
Start-Sleep -s 20
Remove-SPODeletedSite -Identity $siteCollURL

Run the resulting block of commands at the SharePoint Online Management Shell prompt.

Reference:

According to this documentation the deletion of the site collection may not be instant. So I would give it some time and check again.

When you delete a group, there can be a delay before the site is removed from SharePoint.

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top