Deleting a SharePoint Team Site When ‘We couldn’t find the Microsoft 365 Group connected to this site’
This is a fun challenge. I’ve run into this multiple times and always just thrown up my hands after a while. This time, I decided to dig deeper, and my pal Lauri Ellis at Microsoft dug up a solution for me via the MVP channels.
Occasionally, we end up with a Team Site which had an M365 Group, but no longer seems to. We can see this when we look at the site in the SharePoint Admin Center. When we do, we get this message:

If we try to delete the site, we get this:

If we try to delete the site with PowerShell, still no joy:

Sure, but the M365 Group doesn’t exist.
The fix Lauri suggested is actually pretty easy, but I had never thought of it before. Using the SPO PowerShell module, simply do this:
Set-SPOSite -Identity <site_url> -ClearGroupId
This simply removes the M365 Group’s ID from the site’s settings. From there, you can delete the site – or do whatever else you were blocked by. I haven’t tried it, but I expect you could also use Add-PnPMicrosoft365GroupToSite to reconnect the site to an M365 Group, essentially resurrecting it to its prior state.
The real question here is why a site would end up in this state, but I have no answer for that. Sometimes we find sites where the M365 Group has disappeared, even though the Team Site still thinks it’s connected to one. One theory I found on the Interwebs was if the Team Site was deleted, and it sat in the site Recycle Bin for more than 30 days, the underlying M365 Group would be deleted (they time out after 30 days), and then the Team Site is restored from the Recycle Bin (they don’t time out for 93 days), then the M365 Group would be gone. This seems pretty far-fetched to me, as I think it would be unlikely we’d drag something out of the Recycle Bin after 30 days, but hey, it’s a theory.
Have you seen this in the wild? Any hard evidence for why it has happened?
Addendum
If you should happen to have a Retention Policy applied to the problematic site in Purview, you’ll need to add an exclusion to delete it. But guess what: not as simple as it sounds.
Because the site was originally backed by a Microsoft 365 Group, you can’t just exclude it as if it never was. Even if you add an exclusion as a SharePoint site, when you try to delete the site, you’ll get the message about it being blocked.

The fix here is to add a new Microsoft 365 Group to the site, which you can do with PnP.PowerShell. Add-PnPMicrosoft365GroupToSite | PnP PowerShell
Add-PnPMicrosoft365GroupToSite -Url "https://contoso.sharepoint.com/sites/FinanceTeamsite" -Alias "FinanceTeamsite" -DisplayName "My finance team site group"
This creates a M365 Group and connects it to the site, which you can then add an exclusion for in Purview.
I have a report that shows me daily if any of such cases happen and I have seen 3 such cases between September and December 2025, with none from the year before, so chances are something broke in SPO around that time.
A “legit” reason for this to happen is when SPO has a retention policy that doesn’t allow deletion, which will keep the site still around for all the time specified in that policy. The sites needs to be excluded from that policy to be deleted.
@Giacomo, yes there are a number of different variables which can get us into the situation. Retention Policies are certainly one of them. In some cases, though, I see this happening where Purview isn’t in use at all, so there are other causes, for sure.
The “legit” reason still feels like a bug to me. If the retained site is group-based, IMO the group should also be retained so this doesn’t happen.
@Mark – Had this happen the last week with a customer (sort of). I have seen this many times in the past where a “group” site gets orphaned from the M365 group and then displays the yellow banner in admin center. I’ve never had an issue deleting them either.
In this recent scenario an unexperienced admin deleted an M365 Group (soft-delete) then immediately did a permanent deletion of the group. This group was Teams connected as well.
That left the SharePoint site collection in the Deleted Sites in SP Admin center. We restored the site (it was 2 days later from when the permanent group deletion occurred). When restoring the site there was a pop-up that appeared that said the M365 Group could not be found. Unfortunately, I couldn’t catch all the message before the client clicked continue.
The site restored fine BUT the yellow banner did not appear. The site still showed a Teams icon in the Admin center and template still shows “Team Site” (vs Team Site ). You can tell the site was a Group site. The conversations quick launch is still there, but errors because the group mailbox was gone. For permissions the “[Site name] Members “ (the M365 group) was still part of membership of the site members SP permission group.
It’s probably been a year since I came across an orphaned group site collection with the yellow banner – again, always have been able to delete them.
I’m not certain how this ‘orphan’ has occurred in the past. I suspect from a similar situation where the M365 group is soft deleted and then permanently deleted and then the site is restored before the 30 day grace ends. I do know that if you soft delete the group, the MS Team, or a group connected SP site, restoring any one of them before the 30 day grace ends, the all are restored.
It almost makes sense that SP site is still recoverable after a permanent deletion of the group. And I’m glad that’s the case.
I was not aware of the PnP to reconnect to a new Group. I’ll keep that in my back pocket.
This customer did have Rubrik and I need to check back if they were able to restore just the group or if they would have to restore all tentacles of the group, and what conflicts the restored site would present.
Thanks for sharing your experiences. As you know, there are a lot of variations which can occur here. There are timing differences, order of action differences, etc. I feel like I understand it a lot better now, but I still wish it wasn’t a problem at all!