Get-EntraDeletedGroup
Retrieves soft-deleted groups in Microsoft Entra ID.
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>]
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).
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.
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.
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
.
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.
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.
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.
List all pages.
Type: | System.Management.Automation.SwitchParameter |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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 |
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 |
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 |
Specifies a search string.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
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 |
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]]
System.Object