<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">OpsMgr from SOA to .NET</title><subtitle type="html">Monitoring of Web applications, .NET applications and Service oriented architectures(SOA)</subtitle><id>http://blogs.technet.com/b/dhan/atom.aspx</id><link rel="alternate" type="text/html" href="http://blogs.technet.com/b/dhan/" /><link rel="self" type="application/atom+xml" href="http://blogs.technet.com/b/dhan/atom.aspx" /><generator uri="http://telligent.com" version="5.6.50428.7875">Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><updated>2008-12-31T09:08:15Z</updated><entry><title>Dynamic IT and System Center</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/b/dhan/archive/2009/06/25/dynamic-it-and-system-center.aspx" /><id>http://blogs.technet.com/b/dhan/archive/2009/06/25/dynamic-it-and-system-center.aspx</id><published>2009-06-25T08:28:06Z</published><updated>2009-06-25T08:28:06Z</updated><content type="html">&lt;div class="wlWriterEditableSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c0c42e19-b215-44d4-a9a1-64b079c841a8" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/System+Center" rel="tag"&gt;System Center&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Dynamic+IT" rel="tag"&gt;Dynamic IT&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Microsoft" rel="tag"&gt;Microsoft&lt;/a&gt;,&lt;a href="http://technorati.com/tags/IT+operations" rel="tag"&gt;IT operations&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Enterprise+Architects" rel="tag"&gt;Enterprise Architects&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Management" rel="tag"&gt;Management&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;&lt;a href="http://www.microsoft.com/systemcenter/en/us/default.aspx"&gt;Microsoft System Center &lt;/a&gt;products and solutions help capture and aggregate knowledge of IT infrastructure, policies and best practices to help IT organizations build manageable systems and automate operations to reduce costs, improve application availability and enhance service deliver. I had the unique opportunity of interviewing our General Manager, Vij Rajarajan, for an Arccast episode on ‘DynamicIT, trends in IT operations’. Teresa Horgan, Senior Business Manager of System Center, introduces us both. Vij Rajarajan, GM of System Center, talks to us about his vision of the future of System Center and how it is poised to help Enterprises prepare for new industry trends and challenges. We learn how System Center fits in the &lt;a href="http://www.microsoft.com/presspass/press/2007/jun07/06-04DynamicITVideos.mspx"&gt;DynamicIT&lt;/a&gt; and broader Microsoft strategy. Vij discusses how Enterprise IT Architects can help prepare their organizations for upcoming changes.&lt;/p&gt;  &lt;p&gt;&lt;iframe src="http://channel9.msdn.com/shows/ARCast.TV/ARCastTV-Dynamic-IT-Trends-in-IT-Operations//player" frameborder="0" width="320" scrolling="no" height="325" mce_src="http://channel9.msdn.com/shows/ARCast.TV/ARCastTV-Dynamic-IT-Trends-in-IT-Operations/"&gt;&lt;/iframe&gt;&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3258486" width="1" height="1"&gt;</content><author><name>dhan</name><uri>http://blogs.technet.com/dhan/ProfileUrlRedirect.ashx</uri></author></entry><entry><title>Bulk editing monitor Alert settings and adding descriptions for Web applications</title><link rel="alternate" type="text/html" href="http://blogs.technet.com/b/dhan/archive/2008/12/31/bulk-editing-monitor-alert-settings-and-adding-descriptions-for-web-applications.aspx" /><id>http://blogs.technet.com/b/dhan/archive/2008/12/31/bulk-editing-monitor-alert-settings-and-adding-descriptions-for-web-applications.aspx</id><published>2008-12-31T12:08:15Z</published><updated>2008-12-31T12:08:15Z</updated><content type="html">&lt;p&gt;It has been a while since I posted to the blog. The long break gave me a chance to work on some of the requests I had received to my previous &lt;a href="http://blogs.technet.com/momteam/archive/2008/09/04/actionable-alerts-for-web-applications-in-operations-manager-2007.aspx" target="_blank"&gt;posting&lt;/a&gt;. The posting referred to creating alert descriptions for Web application monitors.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Many people wrote to me that this was a fine solution, but how can you change these settings for each monitor and its alert when you have possibly hundreds of Alerts to update. This can be very cumbersome if using the approach suggested in the blog, by updating the settings using the Console. &lt;/p&gt;  &lt;p&gt;The &lt;a href="http://msdn.microsoft.com/en-us/library/cc268402.aspx" target="_blank"&gt;OpsMgr SDK&lt;/a&gt; provides some handy APIs that can be utilized to do bulk changes as one would need in such a situation. I wrote the code below to change the Alert Settings for ‘Base Page Status code’ unit monitor with a meaningful description. While this code is specific to changing alert settings on the Base page status code monitor, it can be applied to bulk editing any monitor setting.&lt;/p&gt;  &lt;p&gt;The basic approach to editing monitor settings using SDK client is as follows&lt;/p&gt;  &lt;p&gt;1.&amp;#160; Connect to the Management group&lt;/p&gt;  &lt;p&gt;2. Construct a good set of criteria that will get you the monitor collection you want to apply the settings to&lt;/p&gt;  &lt;p&gt;3. Retrieve the monitor collection&lt;/p&gt;  &lt;p&gt;4. For each unit monitor in the collection, update the alert settings&lt;/p&gt;  &lt;p&gt;5. Mark the ManagementPackElementStatus as PendingUpdate so it gets written back&lt;/p&gt;  &lt;p&gt;6. Verify the changes&lt;/p&gt;  &lt;p&gt;7. Apply the changes&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; System;     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; System.Collections.Generic;     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; System.Collections.ObjectModel;     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; System.Text;     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; Microsoft.EnterpriseManagement;     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; Microsoft.EnterpriseManagement.Administration;     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; Microsoft.EnterpriseManagement.Common;     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; Microsoft.EnterpriseManagement.Configuration;     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; Microsoft.EnterpriseManagement.Monitoring;     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;     &lt;p&gt;&amp;#160;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;     &lt;p&gt;&amp;#160;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: blue; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;namespace&lt;/span&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt; WebAlertDescription     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;{     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Program       &lt;p&gt;&lt;/p&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue"&gt;string&lt;/span&gt;[] args)      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ManagementGroup&lt;/span&gt; mg;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ManagementPack&lt;/span&gt; mp;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MonitoringClassCriteria&lt;/span&gt; classCriteria;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MonitoringClass&lt;/span&gt; monitoringClass;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;MonitorCriteria&lt;/span&gt; monitorCriteria;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ReadOnlyCollection&lt;/span&gt; &amp;lt;&lt;span style="color: #2b91af"&gt;ManagementPackMonitor&lt;/span&gt;&amp;gt; monitors;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;mg = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ManagementGroup&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;MGTest&amp;quot;&lt;/span&gt;);      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;mp = mg.GetManagementPacks(&lt;span style="color: #a31515"&gt;&amp;quot;Webtest&amp;quot;&lt;/span&gt;)[0];      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;classCriteria = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;MonitoringClassCriteria&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;DisplayName='Foo test'&amp;quot;&lt;/span&gt;);      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;     &lt;p&gt;&amp;#160;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// Get the monitor collection of all Base page status code monitors&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;monitoringClass = mg.GetMonitoringClasses(classCriteria)[0];      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;monitorCriteria = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;MonitorCriteria&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;DisplayName='Base Page Status Code'&amp;quot;&lt;/span&gt;);      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;// iterate for each request for monitors&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;monitors = mg.GetMonitors(monitorCriteria);      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;foreach&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;ManagementPackMonitor&lt;/span&gt; monitor &lt;span style="color: blue"&gt;in&lt;/span&gt; monitors)      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Update&lt;/span&gt;AlertSettings(monitor, mp);      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;monitor.Status = &lt;span style="color: #2b91af"&gt;ManagementPackElementStatus&lt;/span&gt;.PendingUpdate;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;mp.Verify();      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;     &lt;p&gt;&amp;#160;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: green"&gt;//Save the changes into the management pack.       &lt;p&gt;&lt;/p&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;mp.AcceptChanges();      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;     &lt;p&gt;&amp;#160;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; UpdateAlertSettings(      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ManagementPackMonitor&lt;/span&gt; serviceMonitor,      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ManagementPack&lt;/span&gt; mp      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;)      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;{      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;serviceMonitor.AlertSettings = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ManagementPackMonitorAlertSettings&lt;/span&gt;();      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;serviceMonitor.AlertSettings.AlertOnState = &lt;span style="color: #2b91af"&gt;HealthState&lt;/span&gt;.Error;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;serviceMonitor.AlertSettings.AutoResolve = &lt;span style="color: blue"&gt;true&lt;/span&gt;;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;serviceMonitor.AlertSettings.AlertPriority = &lt;span style="color: #2b91af"&gt;ManagementPackWorkflowPriority&lt;/span&gt;.Normal;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;serviceMonitor.AlertSettings.AlertSeverity = &lt;span style="color: #2b91af"&gt;ManagementPackAlertSeverity&lt;/span&gt;.MatchMonitorHealth;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;serviceMonitor.AlertSettings.AlertParameter1 = &lt;span style="color: #a31515"&gt;@&amp;quot;$Data/Context/RequestResults/RequestResult['1']/BasePageData/StatusCode$&amp;quot;&lt;/span&gt;; &lt;span style="color: green"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;        &lt;p&gt;&lt;/p&gt;     &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; color: green; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;     &lt;p&gt;&amp;#160;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ManagementPackStringResource&lt;/span&gt; alertMessage;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;     &lt;p&gt;&amp;#160;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;alertMessage = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ManagementPackStringResource&lt;/span&gt;(mp, &lt;span style="color: #a31515"&gt;&amp;quot;TESTSampleAlertMessage&amp;quot;&lt;/span&gt;);      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;alertMessage.DisplayName = &lt;span style="color: #a31515"&gt;&amp;quot;Status code message&amp;quot;&lt;/span&gt;;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;alertMessage.Description = &lt;span style="color: #a31515"&gt;&amp;quot;Status code is {0}.&amp;quot;&lt;/span&gt;;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;serviceMonitor.AlertSettings.AlertMessage = alertMessage;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0pt; line-height: normal; mso-layout-grid-align: none"&gt;&lt;span style="font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;}      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 9pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;; mso-bidi-font-size: 10.0pt; mso-no-proof: yes"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;A few notes about the above source code. This source code is a suggested example of bulk editing monitors. It also makes some simplistic assumptions of the selection of monitor criteria, updating the unit monitor settings and the application of changes to a management pack. This was intentional to keep the example short and succinct. For a more robust solution, you may want to customize it to apply changes to the appropriate management pack, for example.&lt;/p&gt;  &lt;p&gt;The selection of monitoring criteria is based on Display Name. This returns all the monitors that match the display name. A more comprehensive solution should select the aggregate monitor for the Web application and use the monitor rollups to find the underlying unit monitor for ‘Base page status code’, or verify that the unit monitor for ‘base page status code’ has the proper target. In case of a name clash, it avoids overwriting the wrong monitor.&lt;/p&gt;  &lt;p&gt;It took me a long time to realize why my changes were not being written back to the Management pack. The ManagementPackElementStatus needs to be set to PendingUpdate. Without this, the changes will not get persisted in the management pack.&lt;/p&gt;  &lt;p&gt;A final note – a more desirable solution would be to have the aggregate monitor alert with the right alert description rather than enabling alert settings on all unit monitors. Now we end up with several unit monitor alerts in addition to the aggregate web application monitor alert – something we want to avoid. However, in the present design of monitors, it is not possible to get the context of the unit monitors at the aggregate monitor level. Hence, this is the best workaround available right now, until we add core functionality to create aggregate monitor context containing the unit monitor’s context. We are looking into that change for a future release.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;For more information about the SDK, I would recommend checking out Jakub’s &lt;a href="http://blogs.msdn.com/jakuboleksy/" target="_blank"&gt;blog&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3174957" width="1" height="1"&gt;</content><author><name>dhan</name><uri>http://blogs.technet.com/dhan/ProfileUrlRedirect.ashx</uri></author></entry></feed>