Skip to content

Get-LMAlert

Terminal window
Get-LMAlert [-Severity <string>] [-Type <string>] [-ClearedAlerts <bool>]
[-CustomColumns <string[]>] [-BatchSize <int>] [-Sort <string>] [<CommonParameters>]
Terminal window
Get-LMAlert [-StartDate <datetime>] [-EndDate <datetime>] [-Severity <string>] [-Type <string>]
[-ClearedAlerts <bool>] [-CustomColumns <string[]>] [-BatchSize <int>] [-Sort <string>]
[<CommonParameters>]
Terminal window
Get-LMAlert -Id <string> [-Severity <string>] [-Type <string>] [-ClearedAlerts <bool>]
[-CustomColumns <string[]>] [-BatchSize <int>] [-Sort <string>] [<CommonParameters>]
Terminal window
Get-LMAlert [-Severity <string>] [-Type <string>] [-ClearedAlerts <bool>] [-Filter <Object>]
[-CustomColumns <string[]>] [-BatchSize <int>] [-Sort <string>] [<CommonParameters>]
Terminal window
Get-LMAlert [-Severity <string>] [-Type <string>] [-ClearedAlerts <bool>] [-FilterWizard]
[-CustomColumns <string[]>] [-BatchSize <int>] [-Sort <string>] [<CommonParameters>]

The Get-LMAlert function retrieves alerts from LogicMonitor based on specified criteria. It supports filtering by date range, severity, type, and cleared status.

Terminal window
#Retrieve alerts from the last 7 days
Get-LMAlert -StartDate (Get-Date).AddDays(-7) -Severity "Error"
Terminal window
#Retrieve a specific alert with custom columns
Get-LMAlert -Id 12345 -CustomColumns "Column1","Column2"

The number of results to return per request. Must be between 1 and 1000. Defaults to 1000.

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

Whether to include cleared alerts. Defaults to $false.

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

Array of custom column names to include in the results.

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

The end date for retrieving alerts. Defaults to current time.

Type: System.DateTime
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Range
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

A filter object to apply when retrieving alerts. Part of a mutually exclusive parameter set.

Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Filter
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

Switch to use the filter wizard interface. Part of a mutually exclusive parameter set.

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: FilterWizard
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

The specific alert ID to retrieve. This parameter is part of a mutually exclusive parameter set.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Id
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

The severity level to filter alerts by. Valid values are "", “Warning”, “Error”, “Critical”. Defaults to "".

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

The field to sort results by. Defaults to “+resourceId”.

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

The start date for retrieving alerts. Defaults to 0 (beginning of time).

Type: System.DateTime
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Range
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

The type of alerts to retrieve. Valid values are "", “websiteAlert”, “dataSourceAlert”, “eventAlert”, “logAlert”. Defaults to "".

Type: System.String
DefaultValue: '*'
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
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.