Get-EntraDeletedDirectoryObject
Retrieves a soft deleted directory object from the directory.
Syntax
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.
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 |
Outputs
System.Object