Skip to content

Commit fc7ef85

Browse files
committed
Updated groups-restore-deleted.md file with MgGraph cmdlets
1 parent a99031a commit fc7ef85

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

articles/active-directory/enterprise-users/groups-restore-deleted.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ ms.collection: M365-identity-device-management
1616
---
1717
# Restore a deleted Microsoft 365 group in Azure Active Directory
1818

19-
When you delete a Microsoft 365 group in Azure Active Directory (Azure AD), part of Microsoft Entra, the deleted group is retained but not visible for 30 days from the deletion date. This behavior is so that the group and its contents can be restored if needed. This functionality is restricted exclusively to Microsoft 365 groups in Azure AD. It is not available for security groups and distribution groups. Please note that the 30-day group restoration period is not customizable.
19+
When you delete a Microsoft 365 group in Azure Active Directory (Azure AD), part of Microsoft Entra, the deleted group is retained but not visible for 30 days from the deletion date. This behavior is so that the group and its contents can be restored if needed. This functionality is restricted exclusively to Microsoft 365 groups in Azure AD. It isn't available for security groups and distribution groups. Please note that the 30-day group restoration period isn't customizable.
2020

2121
> [!NOTE]
22-
> Don't use `Remove-MsolGroup` because it purges the group permanently. Always use `Remove-AzureADMSGroup` to delete a Microsoft 365 group.
22+
> Don't use `Remove-MsolGroup` because it purges the group permanently. Always use `Remove-MgBetaGroup` to delete a Microsoft 365 group.
2323
2424
The permissions required to restore a group can be any of the following:
2525

2626
Role | Permissions
2727
--------- | ---------
28-
Global administrator, Group administrator, Partner Tier2 support, and Intune administrator | Can restore any deleted Microsoft 365 group
29-
User administrator and Partner Tier1 support | Can restore any deleted Microsoft 365 group except those groups assigned to the Global Administrator role
28+
Global administrator, Group administrator, Partner Tier 2 support, and Intune administrator | Can restore any deleted Microsoft 365 group
29+
User administrator and Partner Tier 1 support | Can restore any deleted Microsoft 365 group except those groups assigned to the Global Administrator role
3030
User | Can restore any deleted Microsoft 365 group that they own
3131

3232
## View and manage the deleted Microsoft 365 groups that are available to restore
@@ -46,19 +46,21 @@ User | Can restore any deleted Microsoft 365 group that they own
4646

4747
## View the deleted Microsoft 365 groups that are available to restore using PowerShell
4848

49-
The following cmdlets can be used to view the deleted groups to verify that the one or ones you're interested in have not yet been permanently purged. These cmdlets are part of the [Azure AD PowerShell module](https://www.powershellgallery.com/packages/AzureAD/). More information about this module can be found in the [Azure Active Directory PowerShell Version 2](/powershell/azure/active-directory/install-adv2) article.
49+
The following cmdlets can be used to view the deleted groups to verify that the one or ones you're interested in haven't yet been permanently purged. These cmdlets are part of the [Microsoft Graph PowerShell module](/powershell/microsoftgraph/installation?view=graph-powershell-1.0&preserve-view=true). More information about this module can be found in the [Microsoft Graph PowerShell overview](/powershell/microsoftgraph/overview?view=graph-powershell-1.0&preserve-view=true) article.
5050

51-
1. Run the following cmdlet to display all deleted Microsoft 365 groups in your Azure AD organization that are still available to restore.
51+
1. Run the following cmdlet to display all deleted Microsoft 365 groups in your Azure AD organization that are still available to restore. Please install the [Graph](/powershell/microsoftgraph/installation?view=graph-powershell-1.0&preserve-view=true) beta version if it isn't already installed on the machine.
5252

5353

5454
```powershell
55-
Get-AzureADMSDeletedGroup
55+
Install-Module Microsoft.Graph.Beta
56+
Connect-MgGraph -Scopes "Group.ReadWrite.All"
57+
Get-MgBetaDirectoryDeletedGroup
5658
```
5759
58-
2. Alternately, if you know the objectID of a specific group (and you can get it from the cmdlet in step 1), run the following cmdlet to verify that the specific deleted group has not yet been permanently purged.
60+
2. Alternately, if you know the objectID of a specific group (and you can get it from the cmdlet in step 1), run the following cmdlet to verify that the specific deleted group hasn't yet been permanently purged.
5961
60-
```
61-
Get-AzureADMSDeletedGroup –Id <objectId>
62+
```powershell
63+
Get-MgBetaDirectoryDeletedGroup -DirectoryObjectId <objectId>
6264
```
6365
6466
## How to restore your deleted Microsoft 365 group using
@@ -68,20 +70,20 @@ Once you have verified that the group is still available to restore, restore the
6870
1. Run the following cmdlet to restore the group and its contents.
6971
7072
71-
```
72-
Restore-AzureADMSDeletedDirectoryObject –Id <objectId>
73+
```powershell
74+
Restore-MgBetaDirectoryDeletedItem -DirectoryObjectId <objectId>
7375
```
7476
7577
2. Alternatively, the following cmdlet can be run to permanently remove the deleted group.
7678
7779
78-
```
79-
Remove-AzureADMSDeletedDirectoryObject –Id <objectId>
80+
```powershell
81+
Remove-MgBetaDirectoryDeletedItem -DirectoryObjectId <objectId>
8082
```
8183
8284
## How do you know this worked?
8385
84-
To verify that you’ve successfully restored a Microsoft 365 group, run the `Get-AzureADGroup –ObjectId <objectId>` cmdlet to display information about the group. After the restore request is completed:
86+
To verify that you’ve successfully restored a Microsoft 365 group, run the `Get-MgBetaGroup –GroupId <objectId>` cmdlet to display information about the group. After the restore request is completed:
8587
8688
- The group appears in the Left navigation bar on Exchange
8789
- The plan for the group will appear in Planner

0 commit comments

Comments
 (0)