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

%3CLINGO-SUB%20id%3D%22lingo-sub-1276344%22%20slang%3D%22en-US%22%3ERemove-SPOSite%20%3A%20This%20site%20belongs%20to%20an%20Office%20365%20group.%20To%20delete%20the%20site%2C%20you%20must%20delete%20group%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1276344%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3C%2FP%3E%3CP%3Ewhen%20I%20try%20to%20delete%20sitecol%20using%20powershell%20script%20I%20am%20getting%20error%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERemove-SPOSite%20%3A%20This%20site%20belongs%20to%20an%20Office%20365%20group.%20To%20delete%20the%20site%2C%20you%20must%20delete%20the%20group.%3CBR%20%2F%3EAt%20line%3A7%20char%3A1%3CBR%20%2F%3E%2B%20Remove-SPOSite%20-Identity%20%22%3CA%20href%3D%22https%3A%2F%2Fxyz.sharepoint.com%2Fsites%2Fdel1%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fxyz.sharepoint.com%2Fsites%2Fdel1%3C%2FA%3E%20...%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20NotSpecified%3A%20(%3A)%20%5BRemove-SPOSite%5D%2C%20ServerException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20Microsoft.SharePoint.Client.ServerException%2CMicrosoft.Online.SharePoint.PowerShell.RemoveSite%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20executed%20the%20below%20comments%20no%20luck...%26nbsp%3B%3C%2FP%3E%3CP%3ESet-SPOSite%20-Identity%20%22%3CA%20href%3D%22https%3A%2F%2Fxyz.sharepoint.com%2Fsites%2Fdel1%26quot%3B%26nbsp%3B%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fxyz.sharepoint.com%2Fsites%2Fdel1%22%26nbsp%3B%3C%2FA%3E%20-LockState%20%22unlock%22%3C%2FP%3E%3CP%3ESet-SPOSite%20-Identity%20%22%3CA%20href%3D%22https%3A%2F%2Fxyz.sharepoint.com%2Fsites%2Fdel1%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fxyz.sharepoint.com%2Fsites%2Fdel1%3C%2FA%3E%22%20-Owner%20%22xyz%40abc.onmicrosoft.com%22%20-NoWait%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERemove-SPOSite%20-Identity%20%22%3CA%20href%3D%22https%3A%2F%2Fxyz.sharepoint.com%2Fsites%2Fdel1%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fxyz.sharepoint.com%2Fsites%2Fdel1%3C%2FA%3E%22%20-Confirm%3A%24false%3CBR%20%2F%3ERemove-SPODeletedSite%20-Identity%20%22%3CA%20href%3D%22https%3A%2F%2Fxyz.sharepoint.com%2Fsites%2Fdel1%26quot%3B%26nbsp%3B%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fxyz.sharepoint.com%2Fsites%2Fdel1%22%26nbsp%3B%3C%2FA%3E%20-Confirm%3A%24false%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhy%20I%20am%20getting%20error%20like%20this...%20and%20how%20to%20resolve%20this.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1276765%22%20slang%3D%22en-US%22%3ERe%3A%20Remove-SPOSite%20%3A%20This%20site%20belongs%20to%20an%20Office%20365%20group.%20To%20delete%20the%20site%2C%20you%20must%20delete%20g%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1276765%22%20slang%3D%22en-US%22%3EAs%20the%20message%20says%2C%20delete%20the%20Office%20365%20Group%20tied%20to%20the%20site%20and%20you%20are%20done%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fexchange%2Fusers-and-groups%2Fremove-unifiedgroup%3Fview%3Dexchange-ps%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Fexchange%2Fusers-and-groups%2Fremove-unifiedgroup%3Fview%3Dexchange-ps%3C%2FA%3E%3C%2FLINGO-BODY%3E
New Contributor

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.

 

 

1 Reply