Secure Cloud Backup

How to Restore a Deleted Office 365 Groups using PowerShell?

how to Restore a Deleted Office 365 Group using PowerShell ?

By Eddie Pinchasov – Product Director


Microsoft 365 (Office 365) is witnessing massive adoption – one in five corporate employees use it.  A big reason behind it is its efficient collaboration mechanisms such as Teams, OneDrive, and SharePoint. A rather understated, but similarly powerful collaboration tool is Groups. In fact, Groups drives all teamwork across Office 365 – groups allow your employees to easily share and collaboratively work on documents, planners, roadmaps, calendars, etc. So what do you do when a Group is inadvertently deleted? How can you restore a deleted Office 365 Group, and ensure business continuity?

How to Restore a Deleted Office 365 Groups using PowerShell ?

Step-by-step pointers below:

Consider that you have a SharePoint group MarketingO365

How to Restore a Deleted Office 365 Group using PowerShell

This group is used to grant permissions to members of Marketing O365 Members to a team site with important marketing data

Restore Office 365 Deleted Groups

Uh-oh! Someone accidentally deletes the group. How do you restore the group? Either by using the Exchange admin center or by using PowerShell. Here we will detail how to restore a group using PowerShell. Note that you must have Office 365 global administrator permissions or be a former owner of the deleted Office 365 group.

Step #1 Install the latest PowerShell version

For starters, it is mandatory to install the latest preview version of Azure Active Directory PowerShell for Graph. To do that, open Windows PowerShell as an Administrator 

Open Windows PowerShell as an Administrator

Review installed modules using the command:

Get-InstalledModule -Name "AzureAD*"

If you have not installed the Azure PowerShell then you will get this message:

If you have not installed the Azure PowerShell then you will get this message

 

If you have an older version of AzureAD PowerShell it is better to uninstall it and then install the new version.

To uninstall AzureAD run the command:

Uninstall-Module AzureADPreview

Or

Uninstall-Module AzureAD

To install the Azure PowerShell run the command

Install-Module AzureADPreview

Install the Azure PowerShell

Input Y to confirm install from an untrusted source.

Wait for the module to install

Wait for the module to install

Step #2 Restore a deleted  Office 365 Group

Open the Windows PowerShell you’ve just installed with Administrator privileges

Open the Windows PowerShell you’ve just installed with Administrator privileges

Run the command:

Import-Module AzureADPreview

Run the command: Import-Module AzureADPreview

Then connect to your Office 365 tenant

Connect-AzureAD

You will be asked to enter your Office 365 administrator account details

Enter your Office 365 administrator account details

You will then receive a message with the connection details

You will then receive a message with the connection details

To get a list of deleted groups run the command

Get-AzureADMSDeletedGroup
Run the command Get-AzureADMSDeletedGroup

Enter the group ID you wish to restore:

Restore-AzureADMSDeletedDirectoryObject -Id <objectId>

Enter the group ID you wish to restore:

And voila! The group will be accessible in the Office 365 admin center and on SharePoint

Restored Office 365 group

For further information, see the Microsoft help center. Note, that restoring the group will restore all related objects:

  • Azure Active Directory (AD) Office 365 groups object properties and members
  • Group e-mail
  • Common Exchange Inbox
  • SharePoint Online team site and files
  • OneNote notebook
  • Planner
  • Teams
  • Yammer group and group content (If the Office 365 group was created from Yammer)

New call-to-action

Limitations

Only Office 365 groups can be restored; security groups are permanently deleted and cannot be restored. A quick tip: even with planned group deletions, use the Remove-AzureADMSGroup command to soft delete Office 365 groups. However, even a soft-deleted group is stored only for 30 days, after this period the group is deleted permanently. 

A deleted group can cause considerable disturbance to your business processes and workflows. The same holds true for deleted emails, OneDrive files, SharePoint sites, etc. Apart from accidental or malicious deletion, you can also suffer Office 365 data loss due to malware attacks that are getting more ingenious and malicious by the day.

As the IT Admin, the onus for protecting the data rests with you. Mitigate the risk of a data breach with a dependable Office 365 backup and recovery solution – the most efficient way to recover data quickly and seamlessly.

How CloudAlly can help

CloudAlly’s Office 365 Groups backup and recovery solution, comprehensively backs up Office 365 Mail, Calendar, Contacts, and Tasks. Blunt the risk of data loss and facilitate easy self-service recovery with CloudAlly’s top-rated SaaS backup that was named by Newsweek as one of the Best Business Tools of 2019.

Try our full-featured trial now and ensure that your organization is protected from Office 365 data loss. 

dotted_BLUE_horizontal_divider
Subscribe to our latest blog posts
Get Posts Via Email - With the latest insights on cloud-to-cloud backup.
CloudAlly talk
Get the latest insights on cloud-to-cloud backup to your inbox.

Click the RSS icon below sign up and get our blog posts by RSS

Twitter Latest tweets
Get the latest insights on cloud-to-cloud backup to your inbox.