When Office 365 Groups are deleted they are retained for 30 days by default in a “soft deleted” state. Administrators can restore the group within that period if desired. All of the Group data, including associated applications such as Teams and Planner is included in this restore capability. It works, but as I discovered in my testing, the process takes some time to complete in the background, and not all data and services will be immediately available after a restore.

To give this new capability a test I created three new Groups using Outlook, Teams, and Planner (actually four, because of an error in Planner). The new Groups appeared in my Office 365 Groups report output as new Groups.

Restoring Deleted Office 365 Groups

Next, I deleted each Group through the same application that was used to create it. Another run of the report script shows the Groups as deleted.

Restoring Deleted Office 365 Groups

Originally the Groups recovery process was only available in PowerShell. Microsoft has since added the ability to recover a Group using the Exchange Admin Center.

Restoring Deleted Office 365 Groups

The PowerShell-driven process involves a few more steps, as you’d expect. To view a list of soft deleted Groups we can use the Get-AzureADMSDeletedGroup cmdlet in PowerShell. This cmdlet is available today in the AzureADPreview PowerShell module, and we can expect it to be added to the AzureAD module in the near future.

PS C:\> Get-AzureADMSDeletedGroup

Id                                      DisplayName                             Description
--                                      -----------                             -----------
7c3d972b-0e25-49ab-baaa-4dcb3a0c39dc    GRP-CreatedViaPlanner                   GRP-CreatedViaPlanner
d1ddaca7-22e6-4267-9795-d208592f2ef1    GRP-CreatedViaOutlook                   GRP-CreatedViaOutlook
fcb8e99e-ca17-441f-8ba0-66bb8c435b12    GRP-CreatedViaTeams                     GRP-CreatedViaTeams

Once you know the Id of the Group you want to restore, the Restore-AzureADMSDeletedDirectoryObject cmdlet is used to restore it.

PS C:\> Restore-AzureADMSDeletedDirectoryObject -Id d1ddaca7-22e6-4267-9795-d208592f2ef1

Id                                      DisplayName                             Description
--                                      -----------                             -----------
d1ddaca7-22e6-4267-9795-d208592f2ef1    GRP-CreatedViaOutlook                   GRP-CreatedViaOutlook

Microsoft warns that this process should take only a few minutes, but can take up to 24 hours in some cases. When the restore is complete, the Group will be available using Get-AzureADMSGroup.

PS C:\> Get-AzureADMSGroup -Id d1ddaca7-22e6-4267-9795-d208592f2ef1

Id                                      DisplayName                             Description
--                                      -----------                             -----------
d1ddaca7-22e6-4267-9795-d208592f2ef1    GRP-CreatedViaOutlook                   GRP-CreatedViaOutlook

The restored Group now appears as a new Group in my report.

Restoring Deleted Office 365 Groups

One thing I noticed in my testing is that the Group members are restored along with the Group, except for the Group admin. In my case, all three Groups that I deleted using Jane Tulley’s account, did not restore her membership of those Groups. For the Outlook and Planner-created Groups, Jane was able to simply rejoin them, because they were public Groups (which is the default).

For the Teams-created Group, the Group type defaulted to private. When Jane attempts to rejoin, an approval request is sent to the Group admin, which is herself in this case. Clicking the link to “go to Group members” and add herself didn’t work.

Restoring Deleted Office 365 Groups

The dialog for adding members shows that she is the admin, but won’t let her add herself as a member.

Restoring Deleted Office 365 Groups

If she uses the Approve button in the email instead, then her membership is approved successfully.

Restoring Deleted Office 365 Groups

However, although the rejoined Group appears in Jane’s Outlook, it does not appear in her Teams desktop client or web client. As a private Group, the Team also can’t be seen in the list of available public teams to join. However, after changing the Group from private to public, and then waiting a short time, the Team appeared as a public Team for other users who were not already members, but not for Jane Tulley who is a member and admin for the Group. Presumably the Team doesn’t appear in the list of Teams to join for Jane because she’s already a member. Eventually, a few hours later, the Team appeared in Jane’s Teams client.

This seems to be a wider issue with Teams when Groups are restored. I ran the test again, this time with a public Team that had multiple members. Again, the restored Team did not appear in any Teams desktop or web clients until the member was removed from the Group, then they could see the Team in the list. However, attempting to join a restored Team fails.

Restoring Deleted Office 365 Groups

I ran through a variety of test scenarios, creating and deleting Teams. As a side note, here’s a simple one-liner for restoring all soft deleted Groups.

PS C:\> Get-AzureADMSDeletedGroup | foreach {Restore-AzureADMSDeletedDirectoryObject -Id $_.Id}

In some cases, public Teams that had been restored appeared almost immediately for other users to join, however could be joined by new members. The same error shown above was occurring.

Restoring Deleted Office 365 Groups

After a few hours of testing, eventually all of the restored Teams were able to be accessed again, and the public Teams could be joined by new members. This may have all been just a symptom of the delays during restoration that Microsoft indicated could take up to 24 hours.

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for Practical365.com.

Comments

  1. Prodromos

    Hi Paul, thanks for the nice guide. What happens after the 30day retention period? Also, is there a way to expand that retention period? Thanks

Leave a Reply