Edit

Share via


Get-EntraBetaDeletedDevice

Retrieves the list of previously deleted devices.

Syntax

GetQuery (Default)

Get-EntraBetaDeletedDevice

    [-Filter <String>]
    [-All]
    [-Top <Int32>]
    [-Property <String[]>]
    [<CommonParameters>]

GetVague

Get-EntraBetaDeletedDevice

    [-SearchString <String>]
    [-All]
    [-Property <String[]>]
    [<CommonParameters>]

GetById

Get-EntraBetaDeletedDevice

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

Description

The Get-EntraBetaDeletedDevice cmdlet Retrieves the list of previously deleted devices.

Examples

Example 1: Get list of deleted devices

Connect-Entra -Scopes 'Device.Read.All'
Get-EntraBetaDeletedDevice -All | Select-Object DeletedDateTime, Id, AccountEnabled, ApproximateLastSignInDateTime, DeviceId, DisplayName, DeletionAgeInDays | Format-Table -AutoSize
DeletedDateTime         Id                                   AccountEnabled ApproximateLastSignInDateTime DeviceId                             DisplayName      DeletionAgeInDays
---------------         --                                   -------------- ----------------------------- --------                             -----------      -------------------
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           10
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     15
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   28

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-EntraBetaDeletedDevice -All | Select-Object DeletedDateTime, Id, AccountEnabled, ApproximateLastSignInDateTime, DeviceId, DisplayName, DeletionAgeInDays | Format-Table -AutoSize
DeletedDateTime         Id                                   AccountEnabled ApproximateLastSignInDateTime DeviceId                             DisplayName      DeletionAgeInDays
---------------         --                                   -------------- ----------------------------- --------                             -----------      -------------------
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           10
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     15
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   28

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-EntraBetaDeletedDevice -Top 2 | Select-Object DeletedDateTime, Id, AccountEnabled, ApproximateLastSignInDateTime, DeviceId, DisplayName, DeletionAgeInDays | Format-Table -AutoSize
DeletedDateTime         Id                                   AccountEnabled ApproximateLastSignInDateTime DeviceId                             DisplayName      DeletionAgeInDays
---------------         --                                   -------------- ----------------------------- --------                             -----------      -------------------
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           10
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   28

This cmdlet retrieves top two deleted devices. You can use -Limit as an alias for -Top.

Example 4: Get deleted devices using SearchString parameter

Connect-Entra -Scopes 'Device.Read.All'
Get-EntraBetaDeletedDevice -SearchString 'Contoso Desktop' | Select-Object DeletedDateTime, Id, AccountEnabled, ApproximateLastSignInDateTime, DeviceId, DisplayName, DeletionAgeInDays | Format-Table -AutoSize
DeletedDateTime         Id                                   AccountEnabled ApproximateLastSignInDateTime DeviceId                             DisplayName      DeletionAgeInDays
---------------         --                                   -------------- ----------------------------- --------                             -----------      -------------------
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   28

This cmdlet retrieves deleted devices using SearchString parameter.

Example 5: Get deleted devices filter by display name

Connect-Entra -Scopes 'Device.Read.All'
Get-EntraBetaDeletedDevice -Filter "DisplayName eq 'Contoso Desktop'" | Select-Object DeletedDateTime, Id, AccountEnabled, ApproximateLastSignInDateTime, DeviceId, DisplayName, DeletionAgeInDays | Format-Table -AutoSize
DeletedDateTime         Id                                   AccountEnabled ApproximateLastSignInDateTime DeviceId                             DisplayName      DeletionAgeInDays
---------------         --                                   -------------- ----------------------------- --------                             -----------      -------------------
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   28

This cmdlet retrieves deleted devices having specified display name.

Example 6: Get deleted device by DeviceObjectId

Connect-Entra -Scopes 'Device.Read.All'
Get-EntraBetaDeletedDevice -DeviceObjectId 'cccccccc-2222-3333-4444-dddddddddddd' | Select-Object DeletedDateTime, Id, AccountEnabled, ApproximateLastSignInDateTime, DeviceId, DisplayName, DeletionAgeInDays | Format-Table -AutoSize
DeletedDateTime         Id                                   AccountEnabled ApproximateLastSignInDateTime DeviceId                             DisplayName      DeletionAgeInDays
---------------         --                                   -------------- ----------------------------- --------                             -----------      -------------------
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   28

This cmdlet retrieves the deleted device specified by DeviceObjectId.

  • -DeviceObjectId parameter specifies the deleted device Id.

Example 7: Get deleted device by DeviceId

Connect-Entra -Scopes 'Device.Read.All'
Get-EntraBetaDeletedDevice -Filter "deviceId eq 'bbbbbbbb-1111-2222-3333-cccccccccccc'"
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 DeviceId.

  • -DeviceId parameter specifies the deleted device Id.

Parameters

-All

List all pages.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

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

-DeviceObjectId

The unique ID of the deleted device to be retrieved.

Parameter properties

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

Parameter sets

GetById
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Filter

Retrieve only those deleted devices that satisfy the filter.

Parameter properties

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

Parameter sets

GetQuery
Position:Named
Mandatory:False
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

-SearchString

Retrieve only those devices that satisfy the -SearchString value.

Parameter properties

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

Parameter sets

GetVague
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Top

The maximum number of devices.

Parameter properties

Type:System.Int32
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Limit

Parameter sets

GetQuery
Position:Named
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:True
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.

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