{"id":2662,"date":"2011-11-20T20:21:05","date_gmt":"2011-11-20T19:21:05","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=2662"},"modified":"2011-11-20T20:21:05","modified_gmt":"2011-11-20T19:21:05","slug":"update-operations-manager-2012-alerts-with-orchestrator","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=2662","title":{"rendered":"Update Operations Manager 2012 alerts with Orchestrator"},"content":{"rendered":"<p>System Center 2012 is soon here and many are already playing with release candidates and beta versions. As you might notice the current Orchestrator integration pack (IP)\u00c2\u00a0for Operations Manager only support Operations Manager 2007 R2. But what if we are running Operations Manager 2012 and Orchestrator in a sandbox and want to try connect them? Some of the activities in the Operations Manager 2007 R2 integration pack might work with Operations Manager 2012, but\u00c2\u00a0as it is unsupported it is not a good idea.\u00c2\u00a0But in Orchestrator we have a generic activity named &#8220;Run .NET Script&#8221;. This activity can be used to run PowerShell script, for example Operations Manager 2012\u00c2\u00a0command shell. To do this we need to first install Operations Manager 2012 console and command shell on each runbook server, then we need to change execution-policy on them, to allow our script. Note that Orchestrator is running PowerShell in 32-bit mode. More info about that <a href=\"http:\/\/blogs.technet.com\/b\/opalis\/archive\/2010\/11\/29\/opalis-6-3-running-powershell-scripts-on-64-bit-operating-systems.aspx\">here<\/a>.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog01.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2666\" title=\"Change execution policy on your runbook servers\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog01-300x55.jpg\" alt=\"\" width=\"300\" height=\"55\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog01-300x55.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog01.jpg 984w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog02.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2667\" title=\"Install Operations Manager 2012 console and command shell\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog02-300x129.jpg\" alt=\"\" width=\"300\" height=\"129\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog02-300x129.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog02.jpg 736w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>When you have done this you might need to reboot your runbook server to load Operations Manager dlls. If you get a event in the application log like the event below, solve it with a runbook server reboot.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog03.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2668\" title=\"20111120_blog03\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog03-300x235.jpg\" alt=\"\" width=\"300\" height=\"235\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog03-300x235.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog03.jpg 580w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Time to build the runbook. It is a pretty simple example but I think it gives you a idea what you could do. The first example will return alert name and alert id for all alerts with resolution state equals new (0). As you can see we first load the Operations Manager module, we then create a connection to the Operations Manager management group. In this example it is running on a server named FIELD-OM8381. We then get name and if for each alert with resolution state 0. On the second image you can see settings to output information from the PowerShell script to the Orchestrator data bus. In this example we publish alert name and alert id to the data bus.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog04.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2671\" title=\"Script to get all new alerts\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog04-300x138.jpg\" alt=\"\" width=\"300\" height=\"138\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog04-300x138.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog04.jpg 603w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog05.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2672\" title=\"Settings for publishing to the databus\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog05-300x200.jpg\" alt=\"\" width=\"300\" height=\"200\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog05-300x200.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog05.jpg 599w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>If we want to update each alert to a new resolution state we could add another Run .NET with a script like the example below. As you can see we use the output from the first activity (alert id) as input to this activity. We configure each alert with resolution state 1, 1 is equal to Orchestrator in my Operations Manager sandbox.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog06.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-2674\" title=\"update resolutionstate\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog06-300x191.jpg\" alt=\"\" width=\"300\" height=\"191\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog06-300x191.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog06.jpg 611w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog07.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-2675\" title=\"both script activities together\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2011\/11\/20111120_blog07.jpg\" alt=\"\" width=\"277\" height=\"141\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>System Center 2012 is soon here and many are already playing with release candidates and beta versions. As you might notice the current Orchestrator integration pack (IP)\u00c2\u00a0for Operations Manager only support Operations Manager 2007 R2. But what if we are running Operations Manager 2012 and Orchestrator in a sandbox and want to try connect them? &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=2662\">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":[61,60],"tags":[],"_links":{"self":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2662"}],"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=2662"}],"version-history":[{"count":10,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2662\/revisions"}],"predecessor-version":[{"id":2679,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2662\/revisions\/2679"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2662"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2662"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2662"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}