Forum Discussion
How to delete Group SPO site if O365Group was deleted?
- Mar 29, 2017
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 ? :)
I know this is an old thread, but the issue still exists. MS support CAN fix this, but MS support is an experience best left for those of you that have infinite patience, unlike me.
So fixing this QUICKLY, just first run set-sposite with -cleargroupID, then run remove-sposite :)
Ref/more thorough steps:
https://www.lieben.nu/liebensraum/2025/12/microsoft-office-server-directory-directoryobjectnotfoundexception/
- NZTECHDec 10, 2025Copper Contributor
The tech has significantly changed since this was first published. We're now using msgraph.
Deleting Team and SharePoint sites thankfully has now become alot more intuitive.