Edit

Share via


Get-EntraDeletedDirectoryObject

Retrieves a soft deleted directory object from the directory.

Syntax

Default (Default)

Get-EntraDeletedDirectoryObject

    -DirectoryObjectId <String>
    [-Property <String[]>]
    [<CommonParameters>]

Description

The Get-EntraDeletedDirectoryObject cmdlet retrieves a soft deleted directory object from the directory. Note that soft delete for groups is currently only implemented for Unified Groups (also known as Office 365 Groups).

Examples

Example 1: Retrieve a deleted directory object with more details

Connect-Entra -Scopes 'AdministrativeUnit.Read.All', 'Application.Read.All','Group.Read.All','User.Read.All'
Get-EntraDeletedDirectoryObject -DirectoryObjectId 'aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb' | Format-Table -Property Id, displayName, '@odata.type', DeletedDateTime, DeletionAgeInDays -AutoSize
Id                                   displayName           @odata.type                  DeletedDateTime       DeletionAgeInDays
--                                   -----------           -----------                  ---------------       -----------------
aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Entra PowerShell App #microsoft.graph.application 2/12/2025 11:07:56 AM                10

This example shows how to retrieve the deleted directory object details from the directory.

Note: You can use the following commands to retrieve specific deleted objects:

  • Get-EntraDeletedUser - to retrieve deleted users.
  • Get-EntraDeletedAdministrativeUnit - to retrieve deleted administrative units.
  • Get-EntraDeletedApplication - to retrieve deleted applications.
  • Get-EntraDeletedDevice - to retrieve deleted devices.
  • Get-EntraDeletedGroup - to retrieve deleted groups.
  • Get-EntraDeletedServicePrincipal - to retrieve deleted service principals.

Parameters

-DirectoryObjectId

The Id of the directory object to retrieve.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Id

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Property

Specifies properties to be returned.

Parameter properties

Type:

System.String[]

Default value:None
Supports wildcards:False
DontShow:False
Aliases:Select

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Outputs

System.Object