Recently, I tried to restore a site that was deleted a few days ago from the SharePoint Online admin center. However, I encountered an error stating, “Couldn’t restore site. We couldn’t find the Office 365 group connected to this site.”
In this tutorial, we’ll discuss how to solve the “Couldn’t restore site. We couldn’t find the Office 365 group connected to this site” error that occurs when trying to restore a SharePoint Online site from the admin center recycle bin.
We couldn’t find the Office 365 group connected to this site
In my case, I deleted the associated Office 365 group, which caused the issue. Another reason for the error could be that the Owner assigned to the SharePoint Online Site may not be available or deleted from the tenant.
When I delete a Team site connected to a Microsoft 365 Group, the SharePoint site associated with it is retained for 93 days in the recycle bin before it’s permanently deleted. However, other group assets such as files, conversations, and calendars are only retained for 30 days before they are permanently deleted.
Instead of restoring the site in the SharePoint admin center, you can restore the SharePoint site using a PowerShell script.
Now, let’s learn how to restore the SharePoint Online site using PowerShell.
Open Windows PowerShell ISE and run the command provided below:
Connect-SPOService -url https://yourtenantid-admin.sharepoint.com -credential MiriamG@szg52.onmicrosoft.com
Restore-SPODeletedSite -Identity https://yourtenantid.sharepoint.com/sites/tausif
Where:
- Connect-SPOService -url https://yourtenantid-admin.sharepoint.com -credential MiriamG@szg52.onmicrosoft.com: This command connects to the SharePoint Online service for your organization using the specified URL and login credentials (username).
- Restore-SPODeletedSite -Identity https://yourtenantid.sharepoint.com/sites/tausif: This command restores a previously deleted SharePoint Online site with the specified URL under your organization’s tenant.
The SharePoint Online site will be restored, and the error “Couldn’t restore site” will not appear.
Moreover, you may like some articles below:
- The Term ‘Get-MsolUser’ is Not Recognized As the Name of a Cmdlet – Solved
- How to Add Comments in PowerShell
- Delete All SharePoint List Items using PowerShell
- How to Convert String to SecureString in PowerShell
- How to Check if a Variable is Null or Empty in PowerShell
I hope this article helped you to resolve the PowerShell error: Couldn’t restore site: We couldn’t find the microsoft 365 group connected to this site error.
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com