My SharePoint Log

Orphaned SharePoint Online Site Collections after an O365 Group


O365 Groups or Unified Groups is a cool O365 feature, except when it don’t work as expected.

You just deleted the Group, but the hidden SharePoint Online Site Collection connected to the group didn’t got deleted automatically with the group.

Guess what it’s now an orphaned site collection in locked state.

To Remove these sites, follow the script below:


##Connect to SPO

Connect-SPOService -Url

#Get all SPO Sites | find your orphaned O365 Group Site Collection

#The SPO site Collection is actually locked, unlock it
Set-SPOSite -Identity -LockState Unlock

#If you were not Site Collection Admin before the O365 Group was deleted
Set-SPOSite -Identity -owner

#Then remove the orphaned site
Remove-SPOSite -Identity -NoWait



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: