Get-LMRecentlyDeleted
Syntax
Section titled “Syntax”Get-LMRecentlyDeleted [[-ResourceType] <String>] [[-DeletedAfter] <DateTime>] [[-DeletedBefore] <DateTime>] [[-DeletedBy] <String>] [[-BatchSize] <Int32>] [[-Sort] <String>] [-ProgressAction <ActionPreference>] [<CommonParameters>]Description
Section titled “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
Section titled “Examples”Example 1
Section titled “Example 1”Get-LMRecentlyDeleted -ResourceType device -DeletedBy "lmsupport"Retrieves every device deleted by the user lmsupport over the past seven days.
Example 2
Section titled “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
Section titled “Parameters”-ResourceType
Section titled “-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
Section titled “-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
Section titled “-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
Section titled “-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
Section titled “-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: FalseSort 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
Section titled “-ProgressAction”Fill ProgressAction Description
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseCommonParameters
Section titled “CommonParameters”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
Section titled “Inputs”Outputs
Section titled “Outputs”You must establish a session with Connect-LMAccount prior to calling this function.