New feature: Recover deleted Office 365 Group via PowerShell

If you've deleted an Office 365 group, it's now retained by default for a period of 30 days. Within that period, you can now restore the group and its associated apps and data via a new PowerShell cmdlet. For additional information please go to https://aka.ms/groupssoftdelete.

Re: New feature: Recover deleted Office 365 Group via PowerShell

Yes I saw the 30 days but when looking at a soft deleted Group you currently cannot see how many days it has left before permanent deletion or when it was deleted. I was just curious if this is something currently being talked about to surface through the supporting cmdlets. I believe I can get it through the audit log if needed.

Re: New feature: Recover deleted Office 365 Group via PowerShell

Awesome news, glad you finally relased this feature! Some more information on what happens when you soft-delete a group might be useful, for example can the group still receive mail, what happens if some group content is on hold (i.e. how it is handled in respect to all workloads; what happens if you try to hard-delete), etc.

Re: New feature: Recover deleted Office 365 Group via PowerShell

@Christophe Fiessinger I've been testing this and there seems to be some inconsistency, or perhaps just delays in how the restoration is processed in the back end.

The issues I'm noticing are:

The Group owner/admin who deletes the Group is not included as a member when the Group is restored. In one case I had to go through the process of requesting to join, then approving my own request, to get back into the Group.

Some public Teams that have been restored are unable to be joined by others afterwards.

It's inconsistent though. Two Teams (one private, one public, both with an admin and a single non-admin member) were deleted and restored without issue. Meanwhile others that I restored over an hour ago are still unable to be joined.

I haven't noticed any issues within Outlook or Planner though (other than the cases where the admin wasn't restored), this is all Teams issues.

Edit: eventually it seems they've come good again. Is everything I saw there just the expected/possible delay of up to 24 hours for the full restoration process to complete?

Re: New feature: Recover deleted Office 365 Group via PowerShell

Agree, and I would like to know if that it's the case...to me it makes sense taking into account what we know about delays when creating Groups from different sides...for instance the highest delay I'm currently seeing is the one that happens between you create a modern team site and you have the EXO inbox created

Re: New feature: Recover deleted Office 365 Group via PowerShell

I just needed the restore for a group which is being used in a production environment. I did the restore 15 min ago and the timeline of the conversations is already back(this took like 5 min).

It is only taking some more time to restore the Onenote and SharePoint data. Are there any insights on how long it will take before everything is restored. Or is this the delay part, what i am waiting for now?

Re: New feature: Recover deleted Office 365 Group via PowerShell

@Christophe FiessingerWhen i now navigate to the group from outlook web. I get in the group. Only when i go to files i get. the message: That there is no data and that i can start using the area. When i navigate to the Library i get an 403 error page cannot be found. Does this means it is still restoring?

Re: New feature: Recover deleted Office 365 Group via PowerShell

From the documentation mentioned above:

This process usually takes just a few minutes but in a few rare cases it can take as long as 24 hours to completely restore. To verify that the group has been successfully restored, run this command in PowerShell:

Get-AzureADGroup –ObjectId <objectId>

Once the restore has successfully completed, the group should reappear on the navigation pane in Outlook and Outlook on the web and all restored content, including SharePoint and Planner, should be available to the group members again.

Re: New feature: Recover deleted Office 365 Group via PowerShell

Christophe Fiessinger wrote:

From the documentation mentioned above:

This process usually takes just a few minutes but in a few rare cases it can take as long as 24 hours to completely restore. To verify that the group has been successfully restored, run this command in PowerShell:

Get-AzureADGroup –ObjectId <objectId>

Once the restore has successfully completed, the group should reappear on the navigation pane in Outlook and Outlook on the web and all restored content, including SharePoint and Planner, should be available to the group members again.

I think you should reword that. The "few minutes" hasn't been true for any of my test cases so far.

Also, the Group appears in the Get-AzureADGroup output (indicating it's been restored successfully) long before all the content in different apps is available.

And also, the Group appears in the Outlook navigation pane long before all the content in different apps is available.

Perhaps a more accurate wording would be to say that the Get-AzureADGroup output or the appearance in Outlook confirms that the restore has *started*, and that it may process for several hours before all services are available again. That would set expectations better than the current wording.

Re: New feature: Recover deleted Office 365 Group via PowerShell

I totally agree with that. In the time between the success from the command in powershell and the time the restore is actually completed it would be great to see some kind of progress so you know what you are dealing with.This would be a great addition to the script because if one half of the restore is complete and the other half gives you a 403 error. I was wondering if my data would be restored.

Re: New feature: Recover deleted Office 365 Group via PowerShell

I installed Online Services Sign-In Assistant and AzureADPreview 2.0.0.98 on Windows 10 and connected to Azure AD with our tenant admin account, but when I execute Get-AzureADMSDeletedGroup cmdlet I receive the error;

The term 'Get-AzureADMSDeletedGroup' is not recognized as the name of a cmdlet, function, script file, or operable program.Do I need antoher version of the AzureADPreview or am I missing a prerequisite?

Re: New feature: Recover deleted Office 365 Group via PowerShell

Hi Paul,

The 'Get-AzureADMSDeletedGroup' cmdlet is part of AzureADPreview 2.0.0.98 so you should be able to use it if you installed this module. Can you please verify that the module has been installed correctly? You can use "Get-Module AzureADPreview" for that.

If you have installed the correct module on your computer you should be able to use the cmdlet. Please let me know if it still doesn't work.

Re: New feature: Recover deleted Office 365 Group via PowerShell

Hi Rob,

Thanks for your reply.I just got it working, but don't know what the issue was.On Win10 and Server2012R2 the AzureADPreview module installed, but Get-Module AzureADPreview showed no result.On server2008R2 it works. I first installed the PackageManagement PowerShell Modules and the Online Services Sign-In Assistant and that executed Install-Module -Name AzureADPreview.The same steps didn't work on Win10 and Server 2012R2.

Re: New feature: Recover deleted Office 365 Group via PowerShell

@Drew Madelung if you get the lastest module you will see a new property exposed: DeletedDateTime as shown belowGet-AzureADMSDeletedGroup | Sort-Object DisplayName| Format-Table Id, DisplayName, Description, Visibility, DeletedDateTime

Re: New feature: Recover deleted Office 365 Group via PowerShell

I tested the restore process and found that everything came back pretty quickly. I could access the restored Group in Outlook on the Web almost immediately. The SharePoint Team Site took a little longer to restore, maybe 5-10 minutes later.

The only service that hasn't restored yet is Teams. Do we have to wait even longer for Teams? I re-connected Teams to the Group to see if the content was there, it was not. Should the Team automatically reconnect to the Group after restore? Will it still restore the content even after I've re-connected Teams to the Group?

RE: New feature: Recover deleted Office 365 Group via PowerShell

My test team doesnt appear to have restored. For this to work and when creating a team is there a pre-requisite of a group for that team already existing? Therefore, (1) create group first and then (2) create team and link it to that group - then when you do the restore it restores the team? Seems long-winded but if that's the solution then that's OK.

Re: New feature: Recover deleted Office 365 Group via PowerShell

installed AzureADPreview 2.0.0.127 and Windows management Framework 5.0 on windows 7 64bit. But when I run Get-AzureADMSDeletedGroup, I get "The term 'Get-AzureADMSDeletedGroup' is not recognized as the name of a cmdlet, function, script file, or operable program. Do I need to install anything else in order to run this PowerShell?

Re: New feature: Recover deleted Office 365 Group via PowerShell

What's the procedure for permanent deletion? the -permanent switch is designated for internal Microsoft Use only according to the documentation for the Remove-UnifiedGroup command. And attempting to use it in Azure PowerShell results in the following error: