In our daily line of work, we sometimes need to show server admins and system managers alerts related to their infrastructure. Have you ever tried to copy/paste the Alert Details for an alert? It looks like crap, and contains alot of information the server admins and system managers couldn’t care less about.

To make this a little easier, we created an Alert Task which copies relevant information in the Alert Details to clipboard, namely Timeraised, PrincipalName, Name and Description.

1. Go to Authoring > Tasks.
2. Click «Create a New Task» in the  Tasks pane to the right.
3.  Choose «Alert Command Line» under the Console Tasks folder.
4. Select a management pack to use, or create a new one.
5. Select a Task name, and type in some description if necessary.

6. Type in the application location and parameters exactly as shown below. (The additional settings is not that important).
pic1

Application:
C:WindowsSystem32WindowsPowerShellv1.0powershell.exe

Parameters:
import-module operationsmanager;Get-scomalert -id $ID$ | fl Timeraised,PrincipalName,Name,Description | clip

7. Click Create, and you are done. Now you will find the Alert Task in the Task pane to the right in the Active Alerts view under Monitoring in the Operations Manager Console.

Sidenote: If you want to create a .txt file with the alert, just replace the pipe and clip (| clip) with >> C:tempalert.txt like so:

import-module operationsmanager;Get-scomalert -id $ID$ | fl Timeraised,PrincipalName,Name,Description >> C:tempalert.txt

-F

4 thoughts on “SCOM: Alert Task – Copy alert to clipboard”

  1. Get-SCOMAlert only seems to work on Management Servers, so I changed the Parameters field to:

    New-Object –TypeName PSObject –Prop @{‘TimeRaised’=’$Time Added$’; ‘PrincipalName’=’$PrincipalName$’; ‘Source’ = ‘$MonitoringObjectDisplayName$’; ‘Name’=’$Name$’; ‘Description’ = ‘$Description$’} | fl TimeRaised, PrincipalName, Source, Name, Description | clip

    1. Hi Matt!
      Get-scomalert works on all servers/computers with Operations Manager Console installed. The Operations Manager Shell comes bundeled with the Console.
      But I like your way around this =)

Leave a Reply