Recreate deleted owner groups for SharePoint sites connected with M365
If out-of-the-box (OOB) groups such as owners, members, or visitors, have been accidentally deleted from your SharePoint site, these steps will help you restore them.
End users can unintentionally delete default SharePoint groups, resulting in a groupless state.
Recovery process
The newly created owner group is not associated with the M365 group owners. If a user is added as owner through the modern permission interface, they do not receive permissions for the site by default. Check permissions.
Restore the connection
It is necessary to reconnect the M365 group owners to SharePoint owners. When a team site connected to M365, the M365 group owners are added to the SharePoint owner group.
Further details can be found in the article:
how the M365 group is associated with the SharePoint groups.
We need to run a script.
- connect-pnpOnline -Url https://[Yourdomain].sharepoint.com/sites/[Yourpage] -weblogin
- $m365GroupId = (get-pnpsite -Includes RelatedGroupId).RelatedGroupId
- $m365GroupOwnerClaims = "c:0o.c🙂federateddirectoryclaim provider🙂{0}_o" -f $m365GroupId.Guid.ToString()
- Add-PnPSiteCollectionAdmin -Owners $m365GroupOwnerClaims
- $owner = Get-PnPGroup -AssociatedOwnerGroup 🙂 select Title
- Add-PnPGroupMember -Group $owner.Title -LoginName $m365GroupOwnerClaims 🙂 Out-zero
AfterTo execute the script, the M365 group owners with the SharePoint owner groupconnected.
Related Articles
Is it all SharePoint?
Where files in Microsoft 365 are really stored In Microsoft 365 there are different places where you work with files — for example in Teams, on a SharePoint site, or in your personal OneDrive. This often leads to questions like: “Where are the files ...
Managing SharePoint Online Themes with PowerShell
? Introduction The visual appearance of SharePoint sites plays a key role in user experience and corporate identity... ✅ Prerequisites SharePoint Online Management Shell is installed Administrator rights for SharePoint Online Windows PowerShell 5.x ...
Uploading photos efficiently to SharePoint and Teams (bulk upload via OneDrive)
In many workflows, it is necessary to take photos of projects or documents directly on site using a smartphone and make them available within the company. Uploading these images individually via the Microsoft Teams app wastes valuable time. In this ...
The path length limit in SharePoint Online – What you need to know!
Whether it’s issues with syncing to OneDrive, during governance workshops, or directly from users – the question about path length in SharePoint Online keeps coming up: ? “How is the path length calculated?” ? “What’s the maximum limit?” No wonder ...
Why a Team is Not Visible in Microsoft Teams (Despite SharePoint Access)
Have you invited someone to a project, and while they can see the files in SharePoint, the corresponding Team simply doesn't appear in their Microsoft Teams app? This is a common misunderstanding. In this article, we explain the cause without ...