Forum Discussion
Is it possible to disconnect a site from an O365 group?
Yes this is possible and quite simple, just run Set-SPOSite with the -cleargroupid parameter
ref: https://www.lieben.nu/liebensraum/2025/12/microsoft-office-server-directory-directoryobjectnotfoundexception/
- ArcalightAug 13, 2026Tin Contributor
This was exactly what I needed. I had an orphaned SharePoint site where someone deleted the Team which deleted the M365 group. Our SharePoint sites are all on a retention hold so it wasn't deleted, but the users could no longer access the site because the group was gone. The site's GroupID was still holding the deleted group's value, so I couldn't associate a new group with it. Using the cmdlet you posted cleared the GroupID, which allowed me to create a new group associated with the site. Cheers!
Just for further info in case someone else has this problem, I created the new group by going to https://ORG.sharepoint.com/sites/SITE/_layouts/creategroup.aspx?mode=connectgroup. That takes you to a wizard to setup a new group for the site that only works after the GroupID field is cleared.