Set-SCOMAlert

Set-SCOMAlert

Changes the properties of alerts.

Syntax

Parameter Set: FromAlertDefault
Set-SCOMAlert [[-Comment] <String> ] [[-CustomField1] <String> ] [[-CustomField2] <String> ] [[-CustomField3] <String> ] [[-CustomField4] <String> ] [[-CustomField5] <String> ] [[-CustomField6] <String> ] [[-CustomField7] <String> ] [[-CustomField8] <String> ] [[-CustomField9] <String> ] [[-CustomField10] <String> ] [[-ResolutionState] <Byte> ] [[-Owner] <String> ] [[-TicketId] <String> ] -Alert <MonitoringAlert[]> [-Connector <MonitoringConnector> ] [-PassThru] [ <CommonParameters>]

Detailed Description

The Set-SCOMAlert cmdlet changes the properties of one or more alerts. You can set the ResolutionState parameter to 255 (Closed) to resolve an alert.

Parameters

-Alert<MonitoringAlert[]>

Specifies an array of MonitoringAlert objects. To obtain a MonitoringAlert object, use the Get-SCOMAlert cmdlet.

Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-Comment<String>

Specifies a comment to add to the resolved alert.

Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-Connector<MonitoringConnector>

Specifies a MonitoringConnector object. This parameter specifies the connector that generated the connection string. To obtain a MonitoringConnector object, use the Get-SCOMConnector cmdlet.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-CustomField1<String>

Specifies information to add to the CustomField1 property of the alert.

Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-CustomField10<String>

Specifies information to add to the CustomField10 property of the alert.

Aliases

none

Required?

false

Position?

11

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-CustomField2<String>

Specifies information to add to the CustomField2 property of the alert.

Aliases

none

Required?

false

Position?

3

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-CustomField3<String>

Specifies information to add to the CustomField3 property of the alert.

Aliases

none

Required?

false

Position?

4

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-CustomField4<String>

Specifies information to add to the CustomField4 property of the alert.

Aliases

none

Required?

false

Position?

5

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-CustomField5<String>

Specifies information to add to the CustomField5 property of the alert.

Aliases

none

Required?

false

Position?

6

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-CustomField6<String>

Specifies information to add to the CustomField6 property of the alert.

Aliases

none

Required?

false

Position?

7

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-CustomField7<String>

Specifies information to add to the CustomField7 property of the alert.

Aliases

none

Required?

false

Position?

8

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-CustomField8<String>

Specifies information to add to the CustomField8 property of the alert.

Aliases

none

Required?

false

Position?

9

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-CustomField9<String>

Specifies information to add to the CustomField9 property of the alert.

Aliases

none

Required?

false

Position?

10

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-Owner<String>

Specifies the user name of the owner of the alert.

Aliases

none

Required?

false

Position?

13

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-PassThru

Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-ResolutionState<Byte>

Specifies a resolution state ID.

When Operations Manager generates an alert, its resolution state is set to New. You can change the resolution state for a new alert to Closed or to a custom resolution state that an administrator has created for the management group. The ID for New is 0 and the ID for Closed is 255. You can assign custom resolution states any value between 2 and 254.

Aliases

none

Required?

false

Position?

12

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

-TicketId<String>

Specifies a value for the TicketId property for the alert.

Aliases

none

Required?

false

Position?

14

Default Value

none

Accept Pipeline Input?

true (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Close alerts by using the resolution state

This command gets all alerts with a resolution state of 15 and then passes the alert objects to the Set-SCOMAlert cmdlet by using the pipe operator. The Set-SCOMAlert cmdlet closes the alert by setting the resolution state to 255.

PS C:\> Get-SCOMAlert -ResolutionState 15 | Set-SCOMAlert -ResolutionState 255

Example 2: Change the properties of alerts

This command gets all alerts named Failed Accessing Windows Event Log and then passes the alert objects to the Set-SCOMAlert cmdlet by using the pipe operator. The Set-SCOMAlert cmdlet changes the owner of the alert and sets the value for CustomField1.

PS C:\> Get-SCOMAlert -Name "Failed Accessing Windows Event Log" | Set-SCOMAlert -Owner "CONTOSO\PattiFul" -CustomField1 "Root Cause - Permissions"

Get-SCOMAlert

Resolve-SCOMAlert

Get-SCOMConnector