{"id":2608,"date":"2011-09-25T09:54:31","date_gmt":"2011-09-25T07:54:31","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=2608"},"modified":"2011-10-02T21:33:32","modified_gmt":"2011-10-02T19:33:32","slug":"forward-alerts-by-e-mail","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=2608","title":{"rendered":"Forward Alerts by E-mail"},"content":{"rendered":"<p>In some scenarios\u00c2\u00a0you 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\u00c2\u00a0by e-mail. Start by copy the script, mailforward.ps1, to C:\\scripts on the machine running the console. The create the console task,<\/p>\n<ol>\n<li>In the Operations Manager console, navigate to Authoring &gt; Tasks and create a new task<\/li>\n<li>Create a Console Tasks\/Alert command line. Select a destination management pack and click Next<\/li>\n<li>On the General Properties page, input a task name, for example &#8220;Forward by e-mail&#8221;<\/li>\n<li>On the Command Line page, input<\/li>\n<ul>\n<li>Application: %SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe<\/li>\n<li>Parameters: C:\\scripts\\mailforward.ps1 &#8216;$Name$&#8217; &#8216;$Description$&#8217; &#8216;$Managed Object Name$&#8217;<\/li>\n<li>Working directory: C:\\<\/li>\n<li>Check &#8220;Display output when this task is run&#8221;<\/li>\n<\/ul>\n<li>Click OK to save the task<\/li>\n<\/ol>\n<p>Now, when you select an alert you can see your new task\u00c2\u00a0in 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.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110924_Forward01.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2611\" title=\"20110924_Forward01\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110924_Forward01-300x43.jpg\" alt=\"\" width=\"300\" height=\"43\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110924_Forward01-300x43.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110924_Forward01.jpg 676w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110924_Forward02.jpg\"><img decoding=\"async\" loading=\"lazy\" width=\"294\" height=\"197\" class=\"aligncenter size-full wp-image-2612\" title=\"20110924_Forward02\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110924_Forward02.jpg\" alt=\"\" \/><\/a><\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110924_Forward03.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2614\" title=\"20110924_Forward03\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110924_Forward03-300x283.jpg\" alt=\"\" width=\"300\" height=\"283\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110924_Forward03-300x283.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110924_Forward03.jpg 401w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110924_Forward04.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2615\" title=\"20110924_Forward04\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110924_Forward04-281x300.jpg\" alt=\"\" width=\"281\" height=\"300\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110924_Forward04-281x300.jpg 281w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/20110924_Forward04.jpg 494w\" sizes=\"(max-width: 281px) 100vw, 281px\" \/><\/a><\/p>\n<p>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\u00c2\u00a0and mail server. You can download the script here,\u00c2\u00a0<a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/09\/mailforward.zip\">mailforward<\/a>. 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<\/p>\n<p>Please note that this is provided \u00e2\u20ac\u0153as is\u00e2\u20ac\u009d with no warranties at all.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In some scenarios\u00c2\u00a0you 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\u00c2\u00a0by e-mail. Start by &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=2608\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[19],"tags":[],"_links":{"self":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2608"}],"collection":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2608"}],"version-history":[{"count":13,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2608\/revisions"}],"predecessor-version":[{"id":4441,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2608\/revisions\/4441"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2608"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}