Share via


Resolve-Alert

Resolve-Alert

Resolves an alert.

Syntax

Parameter Set: FromAlert
Resolve-Alert [-Alert] <MonitoringAlert> [[-Comment] <String> ] [-Confirm] [-WhatIf] [ <CommonParameters>]

Detailed Description

Resolves an alert.

Parameters

-Alert<MonitoringAlert>

Specifies the alert to resolve. You can use Get-Alert to create an object to pass as the value of this parameter.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Comment<String>

Specifies a comment to associate with the resolved alert.

Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByValue)

Accept Wildcard Characters?

false

-Confirm

Prompts you for confirmation before executing the command.

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-WhatIf

Describes what would happen if you executed the command without actually executing the command.

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters

Notes

  • For more information, type "Get-Help Resolve-Alert -detailed". For technical information, type "Get-Help Resolve-Alert -full".
    When specifying multiple values for a parameter, use commas to separate the values. For example, "<parameter-name> <value1>, <value2>".

Examples

-------------- EXAMPLE 1 --------------

This command uses Get-Alert to retrieve all alerts. It then pipes the results to Where-Object to only select the ones owned by Ken Meyers. The alerts that pass the filter are piped to Resolve-Alert to be resolved with the comment, "Resolving all of Ken's alerts."

C:\PS>get-alert |
where-object {$_.Owner -eq "kenmeyers"} |
resolve-alert -comment "Resolving all of Ken's alerts."

-------------- EXAMPLE 2 --------------

This command uses Get-Alert to retrieve unresolved alerts. Unresolved alerts have a resolution state equal to 0. The command then loops through all the unresolved alerts, calling Resolve-Alert to resolve each of them. The comment "Resolving Alert" is associated with each resolved alert.

C:\PS>$alerts = get-alert |
where-object {$_.ResolutionState -eq 0}
foreach($alert in $alerts)
{
resolve-alert -comment "Resolving Alert" -Alert $alert
}

Get-Alert

Get-AlertHistory