In some scenariosÂ you want to forward an alert to a engineer direct from the Operations Manager console. In this post I will show you a example how that can be done with a task. The task will run a power shell script that picks up properties of the alert and forward itÂ by e-mail. Start by copy the script, mailforward.ps1, to C:\scripts on the machine running the console. The create the console task,
- In the Operations Manager console, navigate to Authoring > Tasks and create a new task
- Create a Console Tasks/Alert command line. Select a destination management pack and click Next
- On the General Properties page, input a task name, for example “Forward by e-mail”
- On the Command Line page, input
- Application: %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
- Parameters: C:\scripts\mailforward.ps1 ‘$Name$’ ‘$Description$’ ‘$Managed Object Name$’
- Working directory: C:\
- Check “Display output when this task is run”
Now, when you select an alert you can see your new taskÂ in the actions pane, and if you click it you can input a note and a recipient, in the task output your will see the complete e-mail that is sent.
Note that in this example it is only the e-mail alias that you need to input, not the complete e-mail address. If you need to input a complete e-mail address you will need to update the powershell script. You also need to update the script with your e-mail domain, from addressÂ and mail server. You can download the script here,Â mailforward. Place it in C:\scripts on each machine that is running the console, or on a shared disk. Make sure that your task is using the correct path to the script. Do not forget to allow your console workstation to send e-mail. with your mail server
Please note that this is provided â€œas isâ€ with no warranties at all.