Get-EntraDeletedDevice
Retrieves the list of previously deleted devices.
Syntax
Get-EntraDeletedDevice
[-Filter <String>]
[-All]
[-Top <Int32>]
[-Property <String[]>]
[<CommonParameters>]
Get-EntraDeletedDevice
[-SearchString <String>]
[-All]
[-Property <String[]>]
[<CommonParameters>]
Get-EntraDeletedDevice
-DeviceObjectId <String>
[-All]
[-Property <String[]>]
[<CommonParameters>]
Description
The Get-EntraDeletedDevice
cmdlet Retrieves the list of previously deleted devices.
Examples
Example 1: Get list of deleted devices
Connect-Entra -Scopes 'Device.Read.All'
Get-EntraDeletedDevice
DeletedDateTime Id AccountEnabled ApproximateLastSignInDateTime DeviceId DisplayName
--------------- -- -------------- ----------------------------- -------- -----------
11/11/2024 5:16:25 PM bbbbbbbb-1111-2222-3333-cccccccccccc False 7/12/2024 8:36:17 PM aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Network
11/6/2024 7:24:39 PM dddddddd-3333-4444-5555-eeeeeeeeeeee True 10/29/2024 9:07:18 PM eeeeeeee-4444-5555-6666-ffffffffffff iPhone 12 Pro
10/28/2024 4:16:02 PM cccccccc-2222-3333-4444-dddddddddddd True 6/24/2024 8:00:39 PM bbbbbbbb-1111-2222-3333-cccccccccccc Contoso Desktop
This cmdlet retrieves the list of deleted devices.
Example 2: Get list of deleted devices using All parameter
Connect-Entra -Scopes 'Device.Read.All'
Get-EntraDeletedDevice -All
DeletedDateTime Id AccountEnabled ApproximateLastSignInDateTime DeviceId DisplayName
--------------- -- -------------- ----------------------------- -------- -----------
11/11/2024 5:16:25 PM bbbbbbbb-1111-2222-3333-cccccccccccc False 7/12/2024 8:36:17 PM aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Network
11/6/2024 7:24:39 PM dddddddd-3333-4444-5555-eeeeeeeeeeee True 10/29/2024 9:07:18 PM eeeeeeee-4444-5555-6666-ffffffffffff iPhone 12 Pro
10/28/2024 4:16:02 PM cccccccc-2222-3333-4444-dddddddddddd True 6/24/2024 8:00:39 PM bbbbbbbb-1111-2222-3333-cccccccccccc Contoso Desktop
This cmdlet retrieves the list of deleted devices using All parameter.
Example 3: Get top two deleted devices
Connect-Entra -Scopes 'Device.Read.All'
Get-EntraDeletedDevice -Top 2
DeletedDateTime Id AccountEnabled ApproximateLastSignInDateTime DeviceId DisplayName
--------------- -- -------------- ----------------------------- -------- -----------
11/11/2024 5:16:25 PM bbbbbbbb-1111-2222-3333-cccccccccccc False 7/12/2024 8:36:17 PM aaaaaaaa-0000-1111-2222-bbbbbbbbbbbb Network
11/6/2024 7:24:39 PM dddddddd-3333-4444-5555-eeeeeeeeeeee True 10/29/2024 9:07:18 PM eeeeeeee-4444-5555-6666-ffffffffffff iPhone 12
This cmdlet retrieves top two deleted devices.
Example 4: Get deleted devices using SearchString parameter
Connect-Entra -Scopes 'Device.Read.All'
Get-EntraDeletedDevice -SearchString 'Woodgrove Desktop'
DeletedDateTime Id AccountEnabled ApproximateLastSignInDateTime DeviceId DisplayName
--------------- -- -------------- ----------------------------- -------- ------
10/28/2024 4:16:02 PM cccccccc-2222-3333-4444-dddddddddddd True 6/24/2024 8:00:39 PM bbbbbbbb-1111-2222-3333-cccccccccccc Woodgrove Desktop
This cmdlet retrieves deleted devices using SearchString parameter.
Example 5: Get deleted devices filter by display name
Connect-Entra -Scopes 'Device.Read.All'
Get-EntraDeletedDevice -Filter "DisplayName eq 'Woodgrove Desktop'"
DeletedDateTime Id AccountEnabled ApproximateLastSignInDateTime DeviceId DisplayName
--------------- -- -------------- ----------------------------- -------- ------
10/28/2024 4:16:02 PM cccccccc-2222-3333-4444-dddddddddddd True 6/24/2024 8:00:39 PM bbbbbbbb-1111-2222-3333-cccccccccccc Woodgrove Desktop
This cmdlet retrieves deleted devices having specified display name.
Example 6: Get deleted device by DeviceObjectId
Connect-Entra -Scopes 'Device.Read.All'
Get-EntraDeletedDevice -DeviceObjectId 'cccccccc-2222-3333-4444-dddddddddddd'
DeletedDateTime Id AccountEnabled ApproximateLastSignInDateTime DeviceId DisplayName
--------------- -- -------------- ----------------------------- -------- ------
10/28/2024 4:16:02 PM cccccccc-2222-3333-4444-dddddddddddd True 6/24/2024 8:00:39 PM bbbbbbbb-1111-2222-3333-cccccccccccc Woodgrove Desktop
This cmdlet retrieves the deleted device specified by DeviceObjectId.
-DeviceObjectId
parameter specifies the deleted device Id.
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 |
-DeviceObjectId
The unique ID of the deleted device to be retrieved.
Type: | System.String |
Aliases: | Id |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Filter
Retrieve only those deleted devices that satisfy the filter.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | False |
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
Retrieve only those devices that satisfy the -SearchString value.
Type: | System.String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Top
The maximum number of devices.
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