www.contoso.se

Cloud and Datacenter Management by Anders Bengtsson

Forward Alerts by E-mail

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,

  1. In the Operations Manager console, navigate to Authoring > Tasks and create a new task
  2. Create a Console Tasks/Alert command line. Select a destination management pack and click Next
  3. On the General Properties page, input a task name, for example “Forward by e-mail”
  4. 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”
  5. Click OK to save the task

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.

« »

© 2019 www.contoso.se. Theme by Anders Norén.