편집

다음을 통해 공유


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>
   [-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 | Select-Object Id, DisplayName, MailNickname, GroupTypes, DeletedDateTime, DeletionAgeInDays | Format-Table -AutoSize

Id                                   DisplayName    MailNickname GroupTypes DeletedDateTime       DeletionAgeInDays
--                                   -----------    ------------ ---------- ---------------       -----------------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Contoso Group contosogroup {Unified}  2/12/2025 12:34:13 PM                 10

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 | Select-Object Id, DisplayName, MailNickname, GroupTypes, DeletedDateTime, DeletionAgeInDays | Format-Table -AutoSize

Id                                   DisplayName    MailNickname GroupTypes DeletedDateTime       DeletionAgeInDays
--                                   -----------    ------------ ---------- ---------------       -----------------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Contoso Group contosogroup {Unified}  2/12/2025 12:34:13 PM                 10

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 | Select-Object Id, DisplayName, MailNickname, GroupTypes, DeletedDateTime, DeletionAgeInDays | Format-Table -AutoSize

Id                                   DisplayName    MailNickname GroupTypes DeletedDateTime       DeletionAgeInDays
--                                   -----------    ------------ ---------- ---------------       -----------------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Contoso Group contosogroup {Unified}  2/12/2025 12:34:13 PM                 10

This cmdlet retrieves top two deleted groups in the directory. You can use -Limit as an alias for -Top.

Example 4: Get deleted groups containing string 'test2'

Connect-Entra -Scopes 'Group.Read.All'
Get-EntraDeletedGroup -SearchString 'Contoso Group' | Select-Object Id, DisplayName, MailNickname, GroupTypes, DeletedDateTime, DeletionAgeInDays | Format-Table -AutoSize

Id                                   DisplayName    MailNickname GroupTypes DeletedDateTime       DeletionAgeInDays
--                                   -----------    ------------ ---------- ---------------       -----------------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Contoso Group contosogroup {Unified}  2/12/2025 12:34:13 PM                 10

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 'Contoso Group'" | Select-Object Id, DisplayName, MailNickname, GroupTypes, DeletedDateTime, DeletionAgeInDays | Format-Table -AutoSize

Id                                   DisplayName    MailNickname GroupTypes DeletedDateTime       DeletionAgeInDays
--                                   -----------    ------------ ---------- ---------------       -----------------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Contoso Group contosogroup {Unified}  2/12/2025 12:34:13 PM                 10

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' | Select-Object Id, DisplayName, MailNickname, GroupTypes, DeletedDateTime, DeletionAgeInDays | Format-Table -AutoSize

Id                                   DisplayName    MailNickname GroupTypes DeletedDateTime       DeletionAgeInDays
--                                   -----------    ------------ ---------- ---------------       -----------------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Contoso Group contosogroup {Unified}  2/12/2025 12:34:13 PM                 10

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[]
Aliases:Select
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
Aliases:Limit
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