SOLVED

How to delete Group SPO site if O365Group was deleted?

Steel Contributor

usually if you delete an O365Goup, the process will/should delete the Group SPO Site, Group Mailbox, ...

..in my case the GRoup SPO Site remains :(  (opened already a support ticket)

 

i just want to raise one generic question here:

What is usually the process to delete an orphaned Group SPO Site ?

 

Remove-SPOSite does not work because the global admin is/was NOT part of the owner of the Site

Set-SPOSite to change the owner does also not work because it is a GRoup SPO --> owner and members are usually coming via the O365Group.....but the Group is gone

 

maybe i'm misunderstanding something here :(

thank you

stefan

23 Replies

Have you waited some hours for the cleanup process to complete? The SPO site should be automatically deleted after the deletion of the associated Group, but the process could be rather slow to complete.

Anyway, we have already discussed many times the issue... For example give a look to this thread: https://techcommunity.microsoft.com/t5/Office-365-Groups/Force-delete-Group-Site-Collection-after-Gr...

Yes. Around 30 hours ago i have deleted the O365Group but the SPO Site still exists.

..so i would say that i have waited long enough :)

 

Yes i've checked first some of the existing community entries (like the one you have mentioned below) but all of the "workarounds" (example: /_layouts/15/deleteweb.aspx)  have not helped :(

 

i'm just curious what others usually do in that case (spo site not deleted automatically and global admin can not delete it manually because of the missing ownership)

 

thx

I am pretty sure I reported this 4 months ago, it may even be when we were on Yammer still not on MS Tech Community. I do not remember an update on the delete feature since then.....
Yeap, I remember also from time to time this issue of having orphan group sites that are not deleted...have you tried to remove it using PowerShell

I personally have not tried to delete recently in any means.

Yes. I tried to remove it via Remove-SPOSite....but it gives me '"Access Denied" although i'm Global Admin :)

 

In my tenant i see dozens of orphaned SPO Sites :(


I opened already a Support Ticket. Will let you know the outcome

quick update:

i still have plenty of orphaned group spo sites which i can't delete as Global Admin

(Access denied message if i use Remove-SPOSite cmdlet)

 

MS support deleted "manually" some of my orphaned group sites...and closed the ticket (a root cause analysis is not covered with the normal support :(((

 

So i'm still facing the issue that if i delete a O365Group, the underlying SPO Group Site remains (as well the MS Team in case the O365 group was created via Teams).

 

Support told me that Remove-SPOSite should work but in fact it doesn't.

Does anyone have other ideas how i can delete orphaned Group Spo's without contacting MS Support ?

Global admins don't have access to SPO site collections by default which may be causing this issue.

Have you tried to add an account to the Site Collection Admin group of the site and then use that account to run Remove-SPOsite?
best response confirmed by Stefan Fried (Steel Contributor)
Solution

Hello Dean

u mean to set/add an owner to the orphaned Group Site and to delete it afterwards,right (or do you mean a different approach) ?

 

Set-SPOSite -Identity https://<name>/sites/<sitename> -owner xxxxxxx@xxxxx.onmicrosoft.com

Remove-SPOSite -Identity https://<name>/sites/<sitename> -noWait

 

NOW, this works but this didn't work last time because i got the message saying that i can't change the Owner of a GroupSite (using the -owner parameter was not allowed for managing a Group Site)

It seems that MS changed something now.

At least i can delete them know "manually"

 

Do you see in your environment orphaned GROUP SPO's or am i the only one ? :)

 

 

Yes, that is what I meant.

I remember having this type of problem when O365 groups were first available and I had to call MS Support but I have not looked for this in any of my current customers.

hi all

i had the same issue : deleted the group and the site got orphaned. So what i did is first I removed the site permanently using Remove-SPOSite and then Remove-SPODeletedSite. And then I removed the group and voila!!! there were no issues.

Hi all,

 

I have exactly the same issue. I have a few Orphaned Group Sites, but in my case the set/add of an owner with the "Set-SPOSite -Identity" cmd results in "Unable to change Owner property when site is in LockState or No Access" (translated from Dutch).

 

Does anyone has any idea how to get this solved?

okay.. So first you will have to unlock that site. For that you need to do this : Set-SPOSite -identity siteurl -LockState "unlock"
And then assign that account as owner, one you are going to delete it with using : Set-SPOSite -identity siteurl -Owner <account> -nowait
Now you can do the above steps to remove that site permanently

Hi Shivam,

 

Thanks a lot, this worked perfect for me.

it is great to have workarounds , but it is unbelievable that this issue (SPO teamsites are not deleted whenever O365 groups are deleted) still exists after months.

 

 

 

 

 

Hi,

I'm currently experiencing many issues with SharePoint Online site collections. I have around 80 sites that been created but unused, so I want to delete them however I could not remove any of them.

I'm new to SP online and not sure what to do next to move on to next step. below are the error messages i'm getting.

 

When trying to update the Group Site I got this error message "The login name xxxxxx@xxxx.onmicrosoft.com was not found in the tenant." 

 

When using "Remove-SPOSite -Identity https://<name>/sites/<sitename> -noWait" I have the following errors for different sites

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

(I'm afraid if I delete the O365 group, the site retained as I've tried this from the Web browser by going to Site Information -> Delete this site -> Confirm deletion of O365)

Once the group deleted, this is the error that I received.

2. Remove-SPOSite : This site collection can't be deleted because it contains sites that are included in an eDiscovery hold or retention policy.

I check all the retention policy in Admin Central, SharePoint option is not even turn on.  However I do have the "Preservation Hold Library" folder appears on my site. I then use SharePoint designer to update the temHoldReleasedDate to a past date and try the Remove cmd again I got this error message.

3. Remove-SPOSite : The requested operation is not supported for site:

 

I already have a ticket with MS, we went through many different test but no luck. 

 

Any suggestions would be greatly appreciated!!!

 

I would recommend asking these questions in a new conversation thread so that you get the most attention.
In regards to question 1, When you delete an Office Group, it will delete the associated objects, such as SPO sites, that is the correct method to ensure everything gets properly removed.

@Dean Gross 

Just went to the same issue. You need to delete the Office 365 groups in two places. If you delete online in the Admin Center->Groups, you still need to go inside Portal Azure and permanent delete the Groups there. Portal Azure ->Azure  Active Directory -> Groups -> Deleted Groups -> Send them to SPACE :)

 

You give a day or two and the sites will be deleted. :)

 

This whole issue has nothing to do with ediscovery policies.. crazy!

@Julio Limathat is not correct. You do not need to do that in the Azure AD portal, the system will do it for you.

1 best response

Accepted Solutions
best response confirmed by Stefan Fried (Steel Contributor)
Solution

Hello Dean

u mean to set/add an owner to the orphaned Group Site and to delete it afterwards,right (or do you mean a different approach) ?

 

Set-SPOSite -Identity https://<name>/sites/<sitename> -owner xxxxxxx@xxxxx.onmicrosoft.com

Remove-SPOSite -Identity https://<name>/sites/<sitename> -noWait

 

NOW, this works but this didn't work last time because i got the message saying that i can't change the Owner of a GroupSite (using the -owner parameter was not allowed for managing a Group Site)

It seems that MS changed something now.

At least i can delete them know "manually"

 

Do you see in your environment orphaned GROUP SPO's or am i the only one ? :)

 

 

View solution in original post