Skip to content

Get-LMRecentlyDeleted

Terminal window
Get-LMRecentlyDeleted [[-ResourceType] <string>] [[-DeletedAfter] <datetime>]
[[-DeletedBefore] <datetime>] [[-DeletedBy] <string>] [[-BatchSize] <int>] [[-Sort] <string>]
[<CommonParameters>]

The Get-LMRecentlyDeleted function queries the LogicMonitor recycle bin for deleted resources within a configurable time range. Results can be filtered by resource type and deleted-by user, and support paging through the API using size, offset, and sort parameters.

Terminal window
Get-LMRecentlyDeleted -ResourceType device -DeletedBy "lmsupport"
Retrieves every device deleted by the user lmsupport over the past seven days.
Terminal window
Get-LMRecentlyDeleted -DeletedAfter (Get-Date).AddDays(-1) -DeletedBefore (Get-Date) -BatchSize 100 -Sort "+deletedOn"
Retrieves deleted resources from the past 24 hours in ascending order of deletion time.

The number of records to request per API call (1-1000). Defaults to 1000.

Type: System.Int32
DefaultValue: 1000
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 4
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

The earliest deletion timestamp (inclusive) to return. Defaults to seven days prior when not specified.

Type: System.Nullable`1[System.DateTime]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

The latest deletion timestamp (exclusive) to return. Defaults to the current time when not specified.

Type: System.Nullable`1[System.DateTime]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

Limits results to items deleted by the specified user principal.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 3
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

Limits results to a specific resource type. Accepted values are All, device, and deviceGroup. Defaults to All.

Type: System.String
DefaultValue: All
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

Sort expression passed to the API. Defaults to -deletedOn.

Type: System.String
DefaultValue: -deletedOn
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 5
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

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.