You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the RestoreSiteCollection command to restore a deleted SharePoint Site Collection that is in the Recycle Bin, restores the Site Collection, but not its associated Group.
Steps to reproduce
01 - Create a new Team Site Collection using the SharePoint Admin Center (Sites -> Active sites -> Create -> Team site -> give it a name and an administrator)
02 - Review that the new Site Collection do have an associated Group (Microsoft 365 Admin center -> Teams & groups -> Active teams & groups -> a group with the same name as the Site Collection should be visible in the list of Groups)
03 - Delete the Site Collection using the SharePoint Admin Center (Sites -> Active sites -> select the created Site Collection from bullet 01 -> open the menu with the ellipse button (...) -> Delete -> check the check box "Delete the group [GroupName] and all its resources" -> Delete)
04 - Review that the Site Collection is indeed deleted (SharePoint Admin Center -> Sites -> Deleted sites -> the Site Collection must be in the list)
05 - Review that the associated Group is indeed deleted (Microsoft 365 Admin center -> Teams & groups -> Deleted groups -> the Group with the name of the deleted Site Collection should be visible in the list)
06 - Open PowerShell, use the method "Create" or "CreateAsync" to make a PnPContex (authenticate the user) using an Azure App Registration. Set the "SetMinimumLevel" to "LogLevel.Debug" to see verbose logging of the process
07 - Run the next command to restore the Site Collection:
myContext.GetSiteCollectionManager().RestoreSiteCollection(new Uri("https://[domain].sharepoint.com/sites/[SiteCollName]"));
08 - Review in the log shown in PowerShell that there are no errors in the processing
09 - Review in the SharePoint Admin center that the Site Collection is restored (Sites -> Active sites -> Create -> Team site -> the deleted Site Collection should be back in the list)
10 - If you click on the Site Collection name in the list, you will see a message in the properties window saying "We couldn't find the Microsoft 365 Group connected to this site."
11 - Review if the Group is restored using the Microsoft 365 Admin center (Teams & groups -> Active teams & groups -> the Group is not visible in the list)
12 - Review that the Group is still in the deleted groups (Microsoft 365 Admin center -> Teams & groups -> Deleted groups -> the Group with the name of the deleted Site Collection will still be visible in the list)
Expected behavior
The RestoreSiteCollection must restore both elements: the Site Collection and its associated Group. Now it restores only the Site Collection, not the associated Group
@gavdgavd : I'm working on an update that will use Microsoft Graph to first restore the group before the actual site collection is restored. Will report back once that's done
@gavdgavd : a fix has been pushed and will appear in the next nightly build (version 1.6.8 or higher). With this fix when restoring a site collection that has a group connected to it the code first tries to restore the Microsoft 365 group. I'll close this issue, but don't hesitate to either re-open or create a new one when you still have issues. Thanks again for using PnP Core SDK and providing feedback.
Category
Describe the bug
Using the RestoreSiteCollection command to restore a deleted SharePoint Site Collection that is in the Recycle Bin, restores the Site Collection, but not its associated Group.
Steps to reproduce
01 - Create a new Team Site Collection using the SharePoint Admin Center (Sites -> Active sites -> Create -> Team site -> give it a name and an administrator)
02 - Review that the new Site Collection do have an associated Group (Microsoft 365 Admin center -> Teams & groups -> Active teams & groups -> a group with the same name as the Site Collection should be visible in the list of Groups)
03 - Delete the Site Collection using the SharePoint Admin Center (Sites -> Active sites -> select the created Site Collection from bullet 01 -> open the menu with the ellipse button (...) -> Delete -> check the check box "Delete the group [GroupName] and all its resources" -> Delete)
04 - Review that the Site Collection is indeed deleted (SharePoint Admin Center -> Sites -> Deleted sites -> the Site Collection must be in the list)
05 - Review that the associated Group is indeed deleted (Microsoft 365 Admin center -> Teams & groups -> Deleted groups -> the Group with the name of the deleted Site Collection should be visible in the list)
06 - Open PowerShell, use the method "Create" or "CreateAsync" to make a PnPContex (authenticate the user) using an Azure App Registration. Set the "SetMinimumLevel" to "LogLevel.Debug" to see verbose logging of the process
07 - Run the next command to restore the Site Collection:
myContext.GetSiteCollectionManager().RestoreSiteCollection(new Uri("https://[domain].sharepoint.com/sites/[SiteCollName]"));
08 - Review in the log shown in PowerShell that there are no errors in the processing
09 - Review in the SharePoint Admin center that the Site Collection is restored (Sites -> Active sites -> Create -> Team site -> the deleted Site Collection should be back in the list)
10 - If you click on the Site Collection name in the list, you will see a message in the properties window saying "We couldn't find the Microsoft 365 Group connected to this site."
11 - Review if the Group is restored using the Microsoft 365 Admin center (Teams & groups -> Active teams & groups -> the Group is not visible in the list)
12 - Review that the Group is still in the deleted groups (Microsoft 365 Admin center -> Teams & groups -> Deleted groups -> the Group with the name of the deleted Site Collection will still be visible in the list)
Expected behavior
The RestoreSiteCollection must restore both elements: the Site Collection and its associated Group. Now it restores only the Site Collection, not the associated Group
Environment details (development & target environment)
Additional context
None
Thanks for your contribution! Sharing is caring.
The text was updated successfully, but these errors were encountered: