Get-LMRecentlyDeleted
Syntax
Get-LMRecentlyDeleted [[-ResourceType] <String>] [[-DeletedAfter] <DateTime>] [[-DeletedBefore] <DateTime>] [[-DeletedBy] <String>] [[-BatchSize] <Int32>] [[-Sort] <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]Description
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.
Examples
Example 1
Get-LMRecentlyDeleted -ResourceType device -DeletedBy "lmsupport"Retrieves every device deleted by the user lmsupport over the past seven days.
Example 2
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.
Parameters
-ResourceType
Limits results to a specific resource type. Accepted values are All, device, and deviceGroup. Defaults to All.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: 1Default value: AllAccept pipeline input: FalseAccept wildcard characters: False-DeletedAfter
The earliest deletion timestamp (inclusive) to return. Defaults to seven days prior when not specified.
Type: DateTimeParameter Sets: (All)Aliases:
Required: FalsePosition: 2Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False-DeletedBefore
The latest deletion timestamp (exclusive) to return. Defaults to the current time when not specified.
Type: DateTimeParameter Sets: (All)Aliases:
Required: FalsePosition: 3Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False-DeletedBy
Limits results to items deleted by the specified user principal.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: 4Default value: NoneAccept pipeline input: FalseAccept wildcard characters: False-BatchSize
The number of records to request per API call (1-1000). Defaults to 1000.
Type: Int32Parameter Sets: (All)Aliases:
Required: FalsePosition: 5Default value: 1000Accept pipeline input: FalseAccept wildcard characters: False-Sort
Sort expression passed to the API. Defaults to -deletedOn.
Type: StringParameter Sets: (All)Aliases:
Required: FalsePosition: 6Default value: -deletedOnAccept pipeline input: FalseAccept wildcard characters: False-ProgressAction
Fill ProgressAction Description
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseCommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
Outputs
Notes
You must establish a session with Connect-LMAccount prior to calling this function.