Sometimes SharePoint site is looking like a group-based site but in fact it is standalone site. In this article I will explain why it could happen and how to fix it.
Scenario
One of the possible scenarios to get a SharePoint site with a broken connection to group (teams) is the following. Let say we have a good teams-connected SharePoint site. Somebody (one of the team owners) did a clean-up and was looking at the teams channels – chats and files and did not find anything usable. So this person deleted a team (and a SharePoint site behind as well).
Unfortunately, some team members were using the SharePoint site directly (not via Teams), not actively though. After around two months they realized they cannot get to the SharePoint site they used to work before (getting 404 error), so they submit a request to IT support asking what happened to the site and is it possible to restore the data.
IT support found that the team was deleted by some person who already left the company, but the site is still in the SharePoint recycle bin – and it is possible to restore it, as retention period for SharePoint sites is 90 days since deletion. Sadly, it is not possible to restore a Microsoft 365 group and a team (with chat messages etc.) as the retention period for teams is 30 days. IT support restored a SharePoint site.
Now we have a site with broken connection to Microsoft 365 group and team. When you go to the site permissions – you can see that the site is owned by a group identity, but if you click on the group name – nothing happens. If you search for the group name in Microsoft 365 tenant – you will found no such group.
When you get the site object with PowerShell – it says the site has related Microsoft 365 group, but there is no group with the group id in Entra Id.
How the normal SharePoint site looks like
Let us test it from scratch. I will create a new team called “Test-Broken-Team-Site”.
Here is how the normal teams-connected SharePoint site looks like. When you hove a mouse over a site name – a pop-up window appears providing team details.

When you go to the site permissions – you can see that the site is owned by group “SiteName Owners”:

And if you click to the group name – there will be another pop-up window with more information, including group members:

Let us get site object with PnP PowerShell:
$pnpTenantSite = Get-PnPTenantSite -Connection $connectionAdmin -Identity $siteUrl -Detailed
$pnpTenantSite | select Url, Template, IsTeamsConnected, GroupId, RelatedGroupId, Owner | fl
Results:

You can see that IsTeamsConnected property is true and GroupId and RelatedGroupId are specified and the site owner is the same group Id with “_o” suffix.
Compare with the same request against standalone site:

IsTeamsConnected property is false, Group id is “00000000-0000-0000-0000-000000000000” and the site owner is the real user id.
Deleting the team and the site
I also posted some messages in the general team channel and created some test sites.
New let me delete the team. It’s possible for any team owner via

What users will see after the team deletion:
“404 FILE NOT FOUND” error upon any attempt to go to the SharePoint site via browser:

The deleted group under “https://myaccount.microsoft.com/groups/deleted-groups”:

From the admin standpoint the deleted resource looks like.
The deleted group under “deleted groups” in Entra Id and under Microsoft 365 admin center (note that it’s 30 days group can be restored):

Deleted site under SharePoint admin center “Deleted sites”. Notice that sites are retained for 93 days, and the site is marked as Microsoft 365 group connected and with a team.:

Restoring SharePoint site
After 30 days the group got deleted, but SharePoint site is still retained. So we can go ahead and restore SharePoint site from the SharePoint admin center. Let us have a look at the site Memberships. You can see that the site is still owned by the m365 group – but the group does not exist anymore 🙁

That is the reason that uses (team members) will not get access to the site automatically once the SharePoint site is restored. But let us get the SharePoint site PowerShell object:

GroupId is zeroes, which is good, IsTeamsConnected if false, which is correct, but the RelatedGroupId is still the same (as if it is a channel site) and the owner is the same.
User experience (I provided access for myself to this site as admin).
The home page (site root) looks something in between teams-connected and standalone site. There is no teams icon and no pop-up window when hover over the site title. But there is a “Conversation” menu we usually have at group-based (btw it fails if you click on it, because it supposed to send you to the group under Outlook… so you’ll get “Sorry, something went wrong” – “Invalid group id or group alias.”).

Site settings page looks like the group-based site settings page. Compare standalone site settings page:

and broken teams connection site settings page… Specifically, you still do not have “Users and Permissions” section (as it is supposed to be handled via teams and group membership):

And here is one more difference. On a regular standalone site when you are clicking on a gearbox – you can see “Connect to new Microsoft 365 Group” link which would allow user to convert this standalone site to a teams-connected site. Unfortunately, there is no such option in the broken site.

So what should we do? Can we re-connect this site to teams or make it true standalone site? Would this broken site stay as broken forever?
Is there a fix for broken teams connection in SharePoint site
First of all, GroupId and RelatedGroupId are read-only properties, so no need to thing of messing with it.
Let us try to change site primary site owner (remember it was a group) and see what has changed:
Set-PnPTenantSite -Identity $siteUrl -PrimarySiteCollectionAdmin $adminUPN
Hmm… primary site owner is a user, but SharePoint admin center still think the site is owned by non-existing group:


So this did not help.
Let us try “Add-PnPMicrosoft365GroupToSite” to connect site to a new group via PowerShell.
Hooray! This did work!!!
The command worked perfectly:
Add-PnPMicrosoft365GroupToSite -Url $SiteURL -Alias "newM365GroupForBrokenSite" -DisplayName "New Team/Group for a broken site" -KeepOldHomePage
Group was created in Entra Id and connected to SharePoint site:

SharePoint site is owned by a new group (the old one we will delete):

PnP PowerShell object contains correct information:

The only 🙂 problem is it says site is team-connected, but it’s not…
If you click on a Teams icon near to the site title – it’ll give you “We’re still setting up the Microsoft Team for this group” “Please come back in a few minutes” message and it might last forever…


Ok, we have a m365 group and a group-based site without a team. Can we create a team from an existing group? Yes. Let us try it.
When you create a team – there is a link “More create team options”. It leads us to the list of options and one of them – create a team from group. There will be a list of groups and one of them would be our “New Team/Group for a broken site”. Select it. It say ok, a new team created.


Now let us see what we got.
It seems like it worked! Now we have a consistent full-functioning group-based site connected to team.
At the SharePoint site – teams icon redirects us to a team channel.
In the teams app – the team is listed among other teams.
Entra Id displays all the services correctly.
Teams admin center can see the team and all the settings look good.
SharePoint admin center also displays a team correctly. You might want to update “Don’t show team email address in Outlook”.



The only tat might confuse is channels. Long ago when you create a team – a channel named “General” was created by default. Not far ago Microsoft changed creating team experience – now you need to provide a name for channel. As you know – channel is a folder in the default document library. So our “broken” site has a folder “Test-Broken-Team-Site” that used to be a sole channel. When we created a team from an existing group (group with site) – a new default main channel was created named “General”, so under SharePoint we can see two folders, and under teams we can see only “General” channel.


But all our data was under the old folder. Can we fix it? I think of two options.
Option 1 – add a tab to the channel – so we can see the existing folder under the main channel:

Option 2 – moving content of the “old” folder to a “new” folder, then you can delete the old folder and rename channel to the original name.
