Running Tasks with PowerShell and $ID$

Whenever you want to run a Task against an Alert, its so easy to use the $ID$ variable:

Create the powershell script c:\scripts\UpdAlert.ps1 with at least the following lines:

Param($ID)

Import-module OperationsManager

GET-SCOMAlert –id “$ID” | SET-SCOMAlert –TicketID ‘100’ –ResolutionState 249

And create the following Task:

Task

Stay on one of your Alerts and Run the tasks

Refresh (F5) before you check the Alert

You could extend the script with other parameters like Logging Computer and User etc.

Check the Powershell help with the command: Get-Help Setp-SCOMAlert – Detailed to see more parameters.

See you a MMS

Smiley Kåre


Leave a Reply