Microsoft 365 Groups that have been deleted remain in a soft-deleted state for 30 days, after which they are permanently removed. During this period, administrators can recover these groups using Graph PowerShell.
This guide covers:
To view all deleted Microsoft 365 Groups, run:
Get-MgDirectoryDeletedItemAsGroup | Select-Object Id, DisplayName, Description, Mail | Format-Table -AutoSize
This command retrieves all deleted groups along with their ID, Display Name, Description, and Mail properties.
Get-MgDirectoryDeletedItemAsGroup | Export-Csv -Path "C:\DeletedM365Groups.csv" -NoTypeInformation
Note: Exporting deleted groups into a CSV file ensures that you have a backup reference before proceeding with a restore operation.
Once you have identified the group you want to restore, use the Restore-MgDirectoryDeletedItem cmdlet.
Restore-MgDirectoryDeletedItem -DirectoryObjectId dabf9bd7-494c-450c-a359-4bb07216701c
Replace dabf9bd7-494c-450c-a359-4bb07216701c with the ID of the deleted group you want to recover.
Get-MgDirectoryDeletedItemAsGroup | Format-Table Id, DisplayName
Restore-MgDirectoryDeletedItem -DirectoryObjectId <GroupId>
Get-MgGroup -Filter "DisplayName eq 'Restored Group Name'"
Get-MgDirectoryDeletedItemAsGroup | Select-Object Id, DisplayName
Deleted Microsoft 365 groups are retained in a soft-deleted state for 30 days. After this period, the group is permanently deleted and cannot be recovered via Graph PowerShell or the admin center.
No. Once the 30-day grace period has passed, the group and all associated data (including Teams, SharePoint, and Planner content) are irretrievably deleted.
Most properties, including group name, description, members, and content in linked services (like Teams, Planner, and SharePoint), are restored. However, some settings such as external sharing permissions or custom configurations might need to be manually reviewed or reconfigured.
Error | Cause | Solution |
Resource not found (404) | The group was permanently deleted. | Check the retention period and ensure it is within 30 days. |
Insufficient privileges to complete the operation | You lack the required permissions. | Run Connect-MgGraph -Scopes Group.ReadWrite.All and ensure you have Global Admin or Group Administrator rights. |
DirectoryObjectNotFound | Incorrect Group ID or group no longer exists. | Verify the Group ID using Get-MgDirectoryDeletedItemAsGroup. |
Microsoft 365 Groups remain recoverable for 30 days after deletion, and using Graph PowerShell, administrators can quickly list and restore them.
By following the steps outlined in this guide, you can:
Try it out in your environment and customize it based on your requirements. Let us know if you found this useful by writing to us @ m365corner@gmail.com