Forum Discussion

Arul_Britto's avatar
Arul_Britto
Copper Contributor
Apr 02, 2020

Remove-SPOSite : This site belongs to an Office 365 group. To delete the site, you must delete group

Hi 

when I try to delete sitecol using powershell script I am getting error:

 

Remove-SPOSite : This site belongs to an Office 365 group. To delete the site, you must delete the group.
At line:7 char:1
+ Remove-SPOSite -Identity "https://xyz.sharepoint.com/sites/del1 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Remove-SPOSite], ServerException
+ FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.RemoveSite

 

 

I executed the below comments no luck... 

Set-SPOSite -Identity "https://xyz.sharepoint.com/sites/del1"  -LockState "unlock"

Set-SPOSite -Identity "https://xyz.sharepoint.com/sites/del1" -Owner "xyz@abc.onmicrosoft.com" -NoWait

 

Remove-SPOSite -Identity "https://xyz.sharepoint.com/sites/del1" -Confirm:$false
Remove-SPODeletedSite -Identity "https://xyz.sharepoint.com/sites/del1"  -Confirm:$false

 

Why I am getting error like this... and how to resolve this.

 

 

Resources