Get-EntraDeletedGroup

Retrieves soft-deleted groups in Microsoft Entra ID.

Syntax

Get-EntraDeletedGroup
   [-Top <Int32>]
   [-All]
   [-Filter <String>]
   [-Property <String[]>]
   [<CommonParameters>]
Get-EntraDeletedGroup
   [-SearchString <String>]
   [-All]
   [-Property <String[]>]
   [<CommonParameters>]
Get-EntraDeletedGroup
   -GroupId <String>
   [-All]
   [-Property <String[]>]
   [<CommonParameters>]
Get-EntraDeletedGroup
   [-All]
   [-SearchString <String>]
   [-Property <String[]>]
   [<CommonParameters>]

Description

The Get-EntraDeletedGroup cmdlet retrieves soft-deleted groups from the directory. Deleted groups can be recovered within 30 days, after which they are permanently deleted.

Soft delete currently applies only to Unified Groups (Office 365 Groups).

Examples

Example 1: Get deleted groups in the directory

Connect-Entra -Scopes 'Group.Read.All'
Get-EntraDeletedGroup

DisplayName Id                                   MailNickname Description GroupTypes
----------- --                                   ------------ ----------- ----------
test21      aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb test21       desc1       {Unified, DynamicMembership}
test22      bbbbbbbb-1111-2222-3333-cccccccccccc test22       desc2       {Unified, DynamicMembership}
test23      cccccccc-2222-3333-4444-dddddddddddd test23       desc3       {Unified, DynamicMembership}
test24      dddddddd-3333-4444-5555-eeeeeeeeeeee test24       desc4       {Unified, DynamicMembership}

This cmdlet retrieves all recoverable deleted groups in the Microsoft Entra ID.

Example 2: Get deleted groups in the directory using All parameter

Connect-Entra -Scopes 'Group.Read.All'
Get-EntraDeletedGroup -All

DisplayName Id                                   MailNickname Description GroupTypes
----------- --                                   ------------ ----------- ----------
test21      aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb test21       desc1       {Unified, DynamicMembership}
test22      bbbbbbbb-1111-2222-3333-cccccccccccc test22       desc2       {Unified, DynamicMembership}
test23      cccccccc-2222-3333-4444-dddddddddddd test23       desc3       {Unified, DynamicMembership}
test24      dddddddd-3333-4444-5555-eeeeeeeeeeee test24       desc4       {Unified, DynamicMembership}

This cmdlet retrieves all recoverable deleted groups in the directory, using All parameter.

Example 3: Get top two deleted groups

Connect-Entra -Scopes 'Group.Read.All'
Get-EntraDeletedGroup -Top 2

DisplayName Id                                   MailNickname Description GroupTypes
----------- --                                   ------------ ----------- ----------
test21      aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb test21       desc1       {Unified, DynamicMembership}
test22      bbbbbbbb-1111-2222-3333-cccccccccccc test22       desc2       {Unified, DynamicMembership}

This cmdlet retrieves top two deleted groups in the directory.

Example 4: Get deleted groups containing string 'test2'

Connect-Entra -Scopes 'Group.Read.All'
Get-EntraDeletedGroup -SearchString 'test2'

DisplayName Id                                   MailNickname Description GroupTypes
----------- --                                   ------------ ----------- ----------
test21      aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb test21       desc1       {Unified, DynamicMembership}
test22      bbbbbbbb-1111-2222-3333-cccccccccccc test22       desc2       {Unified, DynamicMembership}
test23      cccccccc-2222-3333-4444-dddddddddddd test23       desc3       {Unified, DynamicMembership}
test24      dddddddd-3333-4444-5555-eeeeeeeeeeee test24       desc4       {Unified, DynamicMembership}

This cmdlet retrieves deleted groups in the directory, containing the specified string.

Example 5: Get deleted groups filter by display name

Connect-Entra -Scopes 'Group.Read.All'
Get-EntraDeletedGroup -Filter "displayName eq 'test21'"

DisplayName Id                                   MailNickname Description GroupTypes
----------- --                                   ------------ ----------- ----------
test21      aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb test21       desc1       {Unified, DynamicMembership}

This cmdlet retrieves deleted groups in the directory, having the specified display name.

Example 6: Get deleted group by GroupId

Connect-Entra -Scopes 'Group.Read.All'
Get-EntraDeletedGroup -GroupId 'aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb'

DisplayName Id                                   MailNickname Description GroupTypes
----------- --                                   ------------ ----------- ----------
test21      aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb test21       desc1       {Unified, DynamicMembership}

This cmdlet retrieves the deleted group specified by GroupId.

  • -GroupId parameter specifies the deleted group GroupId.

Parameters

-All

List all pages.

Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Filter

Specifies an OData v4.0 filter statement. This parameter controls which objects are returned.

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-GroupId

The GroupId of the deleted group to be retrieved.

Type:System.String
Aliases:Id
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Property

Specifies properties to be returned

Type:System.String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SearchString

Specifies a search string.

Type:System.String
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Top

Specifies the maximum number of records to return.

Type:System.Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

Inputs

System.String

System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

Outputs

System.Object