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).
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