<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>SCOMzilla</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/scom_atlas/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/scom_atlas/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:48:38 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>SCOM 2012 R2 UR9 is now released!!!!!!!!</title>
      <link>https://docs.microsoft.com/archive/blogs/scom_atlas/scom-2012-r2-ur9-is-now-released</link>
      <pubDate>Wed, 27 Jan 2016 07:29:47 GMT</pubDate>
      <dc:creator><![CDATA[Matty T]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/scom_atlas/2016/01/27/scom-2012-r2-ur9-is-now-released/</guid>
      <description><![CDATA[Here is the link to view the UR &nbsp;  Issues that are fixed in this update rollup Operations...]]></description>
      <content:encoded><![CDATA[<p>Here is the <a title="https://support.microsoft.com/en-us/kb/3129774" href="https://support.microsoft.com/en-us/kb/3129774" target="_blank">link</a> to view the UR</p> <p>&nbsp;</p> <div id="mt1" class="kb-moreinformation-section section ng-scope"> <h3 class="sbody-h3">Issues that are fixed in this update rollup</h3> <h4 class="sbody-h4">Operations Manager</h4> <ul> <li><span class="text-base">SharePoint workflows fail with an access violation under APM<br></span><br>A certain sequence of the events may trigger an access violation in APM code when it tries to read data from the cache during the Application Domain unload. This fix resolves this kind of behavior.  <li><span class="text-base">Application Pool worker process crashes under APM with heap corruption</span>  <p>During the Application Domain unload two threads might try to dispose of the same memory block leading to DOUBLE FREE heap corruption. This fix makes sure that memory is disposed of only one time.</p> <li><span class="text-base">Some Application Pool worker processes become unresponsive if many applications are started under APM at the same time</span>  <p>Microsoft Monitoring Agent APM service has a critical section around WMI queries it performs. If a WMI query takes a long time to complete, many worker processes are waiting for the active one to complete the call. Those application pools may become unresponsive, depending on the wait duration. This fix eliminates the need in WMI query and significantly improves the performance of this code path.</p> <li><span class="text-base">MOMAgent cannot validate RunAs Account if only RODC is available</span>  <p>If there's a read-only domain controller (RODC), the MoMAgent cannot validate the RunAs account. This fix resolves this issue.</p> <li><span class="text-base">Missing event monitor does not warn within the specified time range in SCOM 2012 R2 the first time after restart</span>  <p>When you create a monitor for a missed event, the first alert takes twice the amount of time specified time in the monitor. This fix resolves the issue, and the alert is generated in the time specified.</p> <li><span class="text-base">SCOM cannot verify the User Account / Password expiration date if it is set by using Password Setting object</span>  <p>Fine grained password policies are stored in a different container from the user object container in Active Directory. This fix resolves the problems in computing resultant set of policy (RSOP) from these containers for a user object.</p> <li><span class="text-base">SLO Detail report displays histogram incorrectly</span>  <p>In some specific scenarios, the representation of the downtime graph is not displayed correctly. This fix resolves this kind of behavior.</p> <li><span class="text-base">APM support for IIS 10 and Windows Server 2016</span>  <p>Support of IIS 10 on Windows Server 2016 is added for the APM feature in System Center 2012 R2 Operations Manager. An additional management pack Microsoft.SystemCenter.Apm.Web.IIS10.mp is required to enable this functionality. This management pack is located in %SystemDrive%\Program Files\System Center 2012 R2\Operations Manager\Server\Management Packs for Update Rollups alongside its dependencies after the installation of Update Rollup 9.</p> <p><span class="text-base">Important Note</span> One dependency is not included in Update Rollup 9 and should be downloaded separately:</p> <div class="indent">Microsoft.Windows.InternetInformationServices.2016.mp</div> <li><span class="text-base">APM Agent Modules workflow fail during workflow shutdown with Null Reference Exception</span>  <p>The <span class="text-base">Dispose()</span> method of Retry Manager of APM connection workflow is executed two times during the module shutdown. The second try to execute this <span class="text-base">Dispose()</span> method may cause a Null Reference Exception. This fix makes sure that the <span class="text-base">Dispose()</span> method can be safely executed one or more times.</p> <li><span class="text-base">AEM Data fills up SCOM Operational database and is never groomed out</span>  <p>If you use SCOM’s Agentless Exception Monitoring to examine application crash data and report on it, the data never grooms out of the SCOM Operational database. The problem with this is that soon the SCOM environment will be overloaded with all the instances and relationships of the applications, error groups, and Windows-based computers, all which are hosted by the management servers. This fix resolves this issue. Additionally, the following management pack’s must be imported in the following order:</p> <ul class="sbody-free_list"> <li>Microsoft.SystemCenter.ClientMonitoring.Library.mp  <li>Microsoft.SystemCenter.DataWarehouse.Report.Library.mp  <li>Microsoft.SystemCenter.ClientMonitoring.Views.Internal.mp  <li>Microsoft.SystemCenter.ClientMonitoring.Internal.mp </li></ul> <li><span class="text-base">The DownTime report from the Availability report does not handle the Business Hours settings</span>  <p>In the downtime report, the downtime table was not considering the business hours. This fix resolves this issue and business hours will be shown based on the specified business hour values.</p> <p>The updated RDL files are located in the following location:</p> <div class="indent">%SystemDrive%\Program Files\Microsoft System Center 2012 R2\Operations Manager\Server\Reporting</div> <p>To update the RDL file, follow these steps:</p> <ol class="sbody-num_list"> <li>Go to http://MachineName/Reports_INSTANCE1/Pages/Folder.aspx<var class="sbody-var">MachineName</var> //Reporting Server.  <li>On this page, go to the folder to which you want to add the RDL file. In this case, click <strong class="uiterm">Microsoft.SystemCenter.DataWarehouse.Report.Library</strong>.  <li>Upload the new RDL files by clicking the upload button at the top. For more information, see <a id="kb-link-1" href="https://msdn.microsoft.com/en-us/library/ms157332.aspx" target="_self">https://msdn.microsoft.com/en-us/library/ms157332.aspx</a>. </li></ol> <li><span class="text-base">Adding a decimal sign in an SLT Collection Rule SLO in the ENU Console on a non-ENU OS does not work</span>  <p>You run the System Center 2012 R2 Operations Manager Console in English on a computer that has the language settings configured to use a non-English (United States) language that uses a comma (,) as the decimal sign instead of a period (.). When you try to create Service Level Tracking, and you want to add a Collection Rule SLO, the value you enter as the threshold cannot be configured by using a decimal sign. This fix resolves the issue.</p> <li><span class="text-base">SCOM Agent issue while logging Operations Management Suite (OMS) communication failure</span>  <p>An issue occurs when OMS communication failures are logged. This fix resolves this issue.</p></li></ul></div>]]></content:encoded>
    </item>
    <item>
      <title>SCOM 2012 R2 UR7 is now released!!!!!</title>
      <link>https://docs.microsoft.com/archive/blogs/scom_atlas/scom-2012-r2-ur7-is-now-released</link>
      <pubDate>Wed, 12 Aug 2015 13:08:00 GMT</pubDate>
      <dc:creator><![CDATA[Matty T]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/scom_atlas/2015/08/12/scom-2012-r2-ur7-is-now-released/</guid>
      <description><![CDATA[Here is the link to view the UR


Issues that are fixed in this update rollup
Operations...]]></description>
      <content:encoded><![CDATA[<p>Here is the <a title="https://support.microsoft.com/en-us/kb/3064919" href="https://support.microsoft.com/en-us/kb/3064919" target="_blank">link</a> to view the UR</p>
<p></p>
<div class="kb-moreinformation-section section ng-scope" id="mt1">
<h3 class="sbody-h3">Issues that are fixed in this update rollup</h3>
<h4 class="sbody-h4">Operations Manager</h4>
<ul class="sbody-free_list">
<li><span class="text-base">The home page link in the Web Console Noscript.aspx file is vulnerable to cross-site scripting (XSS)</span><br /><br />A security vulnerability exists in the Web Console for System Center 2012 R2 Operations Manager that could allow elevation of privilege if a user goes to an affected website by using a specially crafted URL. This fix resolves that vulnerability. For more information, see&nbsp;<a id="kb-link-1" href="https://technet.microsoft.com/library/security/MS15-086">Microsoft Security Bulletin MS15-086</a>.<br /><br /></li>
<li>&nbsp;<span class="text-base">&quot;Agents by Health State&quot; report shows duplicate entries and inconsistent data</span><br /><br />Sometimes a single agent has multiple entries displayed&nbsp;in the &quot;Agents by Health State&quot; report. The fix for this issue makes sure the most recent state of the agent is displayed in the report.<br /><br /></li>
<li><span class="text-base">Dependent tables are not groomed (Event.EventParameter_GUID table)</span><br /><br />The following issues are fixed:
<ul class="sbody-free_list">
<li>In a database, the grooming of certain MT$X$Y tables were missed because of the filtering logic. Therefore, the tables were never groomed. There were scenarios in which lots of unwanted data was stored in these tables. This issue is now fixed, and data is groomed data from these table. This results in performance gains because there is less data from which to query.</li>
<li>In Data Warehouse, the grooming of certain tables was missed occasionally because current logic expects the rows to be returned in a certain order. This issue is now fixed, and the grooming of these tables will not be missed. In some scenarios, millions of rows were stored in these tables. This issue is now fixed. Data is now groomed from these tables. This results in performance gains because there is less data from which to query.</li>
</ul>
<br /><br /></li>
<li><span class="text-base">Management Packs do not synchronize between management servers</span><br /><br />In a SQL AlwaysOn setup, the SQL in the times of failover does not acknowledge the notifications that are registered by SCOM. This leads to inconsistent data in the environment, and the changes in management pack are not reflected in the whole environment. This update resolves this issue.<br /><br /></li>
<li><span class="text-base">Leaked transaction causes over 100 SPIDs in SCOM database to be permanently blocked by the &quot;p_DataPurging&quot; stored procedure&nbsp;</span><br /><br />Sometimes, because of a leaked transaction in the <span class="text-base">p_DataPurging</span>&nbsp;stored procedure, the SPID becomes stuck. This causes other SPIDs to be blocked, and SCOM is brought to a standstill. This issue is fixed in this update. The fix prevents other SPIDs from being blocked.<br /><br /></li>
<li><span class="text-base">Operations Manager SDK crashes because of SQL errors when QueryResultsReader.Dispose is called</span><br /><br />The Operations Manager SDK could potentially crash when it disposes of a database connection in some scenarios. Additionally, you receive an error message that resembles the following:<br /><br />
<div class="indent">
<div class="sbody-error">Exception object: 00000004058197a0<br />Exception type: System.Data.SqlClient.SqlException<br />Message: A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)<br />InnerException: System.ComponentModel.Win32Exception, Use !PrintException 0000000405819050 to see more.</div>
</div>
<br />This update handles these scenarios gracefully.</li>
<li>&nbsp;<span class="text-base">You can&#39;t view dashboard performance counters that are created by using the TCP Port Monitoring&nbsp;template</span><br /><br />When you use the TCP Port Monitoring template to monitor network connectivity and the availability of local and remote assets, the template is missing a write action to the data warehouse. With the update, you can present this information on dashboards.<br /><br /></li>
<li><span class="text-base">Dynamic inclusion rule is added to a group definition unexpectedly if an explicit member instance of the group disappears</span><br /><br />If all the explicit member instances of the group disappear, a dynamic rule is added to the group unexpectedly. With the update, no dynamic rule is generated in these situations.<br /><br /></li>
<li>&nbsp;<span class="text-base">You can&#39;t create group by using the SQL Server 20XX Installation Seed</span><br /><br />On the <strong class="uiterm">Dynamic Members</strong>&nbsp;tab of the Group Creation wizard, if you have a host class of your desired class, and if you try to select the inherited property of the host class, group creation fails. For example, if you select the&nbsp;<span class="text-base">Display Name(Object)</span> property of <span class="text-base">Host=Windows Computer</span> of the <span class="text-base">Management Server</span>&nbsp;class on the <strong class="uiterm">Dynamic Members</strong>&nbsp;tab, group creation fails, and you receive the following exception:<br /><br />
<div class="indent">
<div class="sbody-error">Processing the template failed. See inner exception for details.<br />Verification failed with 1 errors:<br />-------------------------------------------------------<br />Error 1:<br />Found error in 1|StressCollectPerformancecounterMP|1.0.0.0|UINameSpaceb2240e1340254758bc3a0f1bd0082f4d.Group.DiscoveryRule/GroupPopulationDataSource|| with message:<br />The configuration specified for Module GroupPopulationDataSource is not valid.<br />: Cannot find specified MPSubElement DisplayName, on MPElement= Windows!Microsoft.Windows.Computer, in expression: $MPElement[Name=&quot;Windows!Microsoft.Windows.Computer&quot;]/DisplayName$</div>
</div>
<br />This update resolves this issue.<br /><br /></li>
<li><span class="text-base">Add MPB support to the SCOM online catalog</span><br /><br />The Management Pack catalog supports only&nbsp;those management packs that have the .mp extension and not the .mpb file-name extension. When this feature is implemented, the Management Pack catalog now supports MPB files.<br /><br />This update helps include management packs such as Azure Management Pack and SQL Management Pack on the Management Pack catalog that were not featured because of the .mpb file-name extension.<br /><br /></li>
<li><span class="text-base">Active Directory Integration in Perimeter Network fails when there is only an RODC present</span><br /><br />When Active Directory Integration is enabled, the SCOM agent cannot talk to an RODC to obtain SCP information and instead looks for a RW domain controller. With this update, the Agent obtains SCP information from the RODC if information is available.<br /><br /></li>
<li><span class="text-base">System Center Operations Manager subscriptions that use the filter to search for specific text in the description (of the message) do not work</span><br /><br />When you create a message subscription by using a criterion that contains specific text in the message description, no alerts were received through notifications. With this update, you receive notifications when the message description has specific text.<br /><br /></li>
<li><span class="text-base">CLR load order change</span><br /><br />The current behavior for agents is to choose a CLR version based on the operating system version. For Windows Server 2012 and newer, the .NET Framework 4.0 is loaded. For operating systems older than Windows Server 2012, the .NET Framework 2.0 family is loaded. On management servers, the .NET Framework 2.0 family is loaded. This essentially maps the .NET Framework version used to the version available out-of-box on the server. The problem with the current behavior is that even if the Management Pack author knows that .NET Framework 4.0 is present on the system, it cannot be used.<br /><br />In the new behavior, the agent loads the .NET Framework 4.0 if it is available else it falls back to the .NET Framework 2.0.<br /><br /></li>
<li><span class="text-base">Problems in obtaining monitoring objects by using &quot;managementGroup.EntityObjects.GetObjectReader&quot;</span><br /><br />In large System Center Operations Manager installations, when entity objects under a management group are retrieved by the object reader by using buffered mode, the object reader sometimes encounters System.Collections.Generic.KeyNotFoundException messages. With this update, the object reader ignores the invalid objects if they are not available.<br /><br /></li>
<li><span class="text-base">The &quot;Threshold Comparison&quot; setting in the consecutive-samples-over-threshold monitor cannot be configured</span><br /><br />Although you configured the&nbsp;<strong class="uiterm">Threshold Comparison</strong>&nbsp;setting in the consecutive-samples-over-threshold monitor, the conversion of the Threshold float value from the management pack was incorrect for the German locale and caused monitor configuration failures. This issue is now fixed in this update for every supported locale.<br /><br /></li>
<li><span class="text-base">Agentless Exception Monitoring (AEM) causes the Health Service to crash because the maximum path length of 248 character is exceeded</span><br /><br />When AEM client monitoring is turned on, sometimes the Windows error reporting file is created in a large file hierarchy. In scenarios in which the path is longer than 248 characters, AEM monitoring was causing the Health Service to crash. This issue is fixed.<br /><br /></li>
<li><span class="text-base">After you update management packs, the newly added default (visible) columns to view are not visible automatically</span><br /><br />The first time that a view is opened on the console, registry keys are written in the HKEY_Current_User hive. The customization settings for the user are written in the registry. If the default view changes, the customization settings in the registry are not updated to reflect the new defaults. This update adds the newly added default column in the view.<br /><br /></li>
<li><span class="text-base">Branding update</span><br /><br />Updates the &quot;Operational Insights&quot; name to &quot;Operations Management Suite&quot; in the System Center Operations Management console.<br /><br /></li>
</ul>
</div>
<div class="kb-moreinformation-section section ng-scope" id="mt2">
<h4 class="sbody-h4">UNIX and Linux Management Pack</h4>
<ul class="sbody-free_list">
<li><span class="text-base">In some cases, Unix and Linux agents report incorrect CPU Processor Time</span><br /><br />The Unix and Linux agents use Percent IO Wait Time when calculating the Percent Processor Time for a CPU object. The agents no longer include the IO Wait Time in the calculation when they return Percent Processor Time.</li>
</ul>
<p style="padding:0;margin:0;"></p>
</div>]]></content:encoded>
    </item>
    <item>
      <title>Using SCO to do a daily check on your RunAs Account Distribution</title>
      <link>https://docs.microsoft.com/archive/blogs/scom_atlas/using-sco-to-do-a-daily-check-on-your-runas-account-distribution</link>
      <pubDate>Fri, 22 May 2015 18:16:47 GMT</pubDate>
      <dc:creator><![CDATA[Matty T]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/scom_atlas/2015/05/22/using-sco-to-do-a-daily-check-on-your-runas-account-distribution/</guid>
      <description><![CDATA[While working with Kevin Holman, we thought we would combine our two posts on RunAs Account...]]></description>
      <content:encoded><![CDATA[<p>While working with Kevin Holman, we thought we would combine our two posts on RunAs Account Distribution into a daily runbook that can be&nbsp;run every day, 12 hours,&nbsp;&nbsp;or whatever you prefer&nbsp;through SCO.&nbsp; So to acheive this I am going to use script from <a title="http://blogs.technet.com/b/kevinholman/archive/2015/05/03/automating-run-as-account-distribution.aspx" href="/b/kevinholman/archive/2015/05/03/automating-run-as-account-distribution.aspx">here</a> and modify it a small bit and take some of my <a title="http://blogs.technet.com/b/scom_atlas/archive/2015/05/22/using-scorch-to-auto-deploy-scom-runas-accounts.aspx" href="/b/scom_atlas/archive/2015/05/22/using-scorch-to-auto-deploy-scom-runas-accounts.aspx" target="_blank">automation</a> so that it will work inside of SCO.</p>
<p>In this post I am going to walk you through how to do achieve this when you have put all your RunAs Accounts and Groups into a .CSV file.&nbsp; <br />The runbook will run 2 times a day to verify that you have up to date membership/distribution and don&#39;t have to have a scheduled task or anything else running.<br /><br /><span style="color:#0000ff;text-decoration:underline;"><em><strong>THE OVERALL RUNBOOK</strong></em></span><br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/4718.rb.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/4718.rb.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/4718.rb.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/4718.rb.PNG" border="0" /></a></p>
<p><br /><em><strong><span style="text-decoration:underline;"><span style="color:#0000ff;text-decoration:underline;">1. START TIME ACTIVITY</span></span></strong></em><br />First we need to build our Monitor Date Time activity.&nbsp; I want this to run 12 hours so it will look like this(you can run this to your own desires to meet your SLA):<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/startrb.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/startrb.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/startrb.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/startrb.PNG" border="0" /></a></p>
<p><br /><span style="color:#0000ff;text-decoration:underline;"><strong>2. VERIFY FILE EXISTANCE OF .CSV FILE<br /></strong></span>We need to create our .CSV on the RB Server(make sure it is on the server running the runbook and not the designer) :) It will look like this and <span style="background-color:#ffff00;">you&#39;re always free to change it up but make sure you change the PowerShell that goes along with this</span>!<br /><span style="background-color:#ffff00;">Again, I created mine in the C:\SCOM Folder so make sure to update this as well when you do yours.</span><br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/csv.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/csv.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/csv.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/csv.PNG" border="0" /></a><br /><br />Once this has been created we need to do a validation in the runbook to make sure that the&nbsp;file exists:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/fileexist.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/fileexist.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/fileexist.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/fileexist.PNG" border="0" /></a><br /><br /><span style="color:#0000ff;text-decoration:underline;"><em><strong>2.1 POTENTIAL ERROR HANDLING</strong></em></span><br />Here you can see that I just added different ways of alerting or notifying that file didn&#39;t exist:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/noexist.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/noexist.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/noexist.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/noexist.PNG" border="0" /></a><br /><span style="color:#0000ff;text-decoration:underline;"><em><strong>3. GET DATA FROM CSV</strong></em></span><br />Next we need to import the .CSV Data and break it into useable data for SCO data bus:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/getinfo.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/getinfo.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/getinfo.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/getinfo.PNG" border="0" /></a><br /><br /><strong><span style="text-decoration:underline;">SCRIPT:</span></strong><br />$FilePath= <span style="background-color:#ffff00;">&#39;UPDATE TO POINT TO NAME AND PATH OF FILE FROM PREVIOUS ACTIVITY&#39;</span><br />$Data = Import-CSV $FilePath <br />$Array = @()<br />ForEach ($Row in $Data) <br />{<br />&nbsp;&nbsp; $AccountName= $Row.&#39;Account&#39;<br />&nbsp;&nbsp; $Group = $Row.&#39;SCOMGroup&#39;<br />&nbsp;&nbsp;&nbsp; $str = $AccountName +&quot;,&quot;+ $Group<br />&nbsp;&nbsp;&nbsp; $Array += $str+&quot;;&quot;<br />}<br /><br /><span style="text-decoration:underline;"><strong>PUBLISHED DATA:</strong></span><br />Array -&gt; String -&gt; Array<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/csvpub.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/csvpub.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/csvpub.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/csvpub.PNG" border="0" /></a><br /><br /><span style="color:#0000ff;text-decoration:underline;"><em><strong>4. DEPLOY/VALIDATE ACCOUNTS</strong></em></span><br />Once we have this we can actually do the account Distribution by breaking it into RunAs Account and associated SCOM Group you wish to use ( script from Kevin&#39;s blog modified slightly to pass in the data).<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/deploy.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/deploy.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/deploy.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/deploy.PNG" border="0" /></a><br /><br /><span style="text-decoration:underline;"><strong>SCRIPT:<br /></strong></span>Import-Module OperationsManager<br />New-SCOMManagementGroupConnection <span style="background-color:#ffff00;">YOUR MGMT SERVER<br /><br /><span style="background-color:#ffffff;">#Get all the health service class instances in the management group</span><br /><span style="background-color:#ffffff;">$HealthServiceClass = Get-SCOMclass -DisplayName &quot;Health Service&quot;| Get-SCOMClassInstance</span><br /></span></p>
<p>$Details = <span style="background-color:#ffff00;">&#39;UPDATE TO ARRAY FROM PREVIOUS ACTIVITY&#39;<br /></span>$Info = $Details.Split(&#39;;&#39;)<br />foreach ($Account in $Info)<br />{<br />&nbsp;&nbsp;&nbsp; If (![string]::IsNullOrEmpty($Account))<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Account = $Account.Trim()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $split = $Account.split(&#39;,&#39;)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $RunAsDisplayName = $split[0].Trim()<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $DistGroupName = $split[1].Trim()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Log an event that our script is starting<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write-EventLog &ndash;LogName &#39;Operations Manager&#39; &ndash;Source &ldquo;Health Service Script&rdquo; &ndash;EntryType Information &ndash;EventID 3250&nbsp; &ndash;Message &ldquo;RunAs HealthService Distribution Script Starting for account: ($RunAsDisplayName) and group: ($DistGroupName)&rdquo;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Get the SCOM Run As account by display name<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $RunAs = Get-SCOMRunAsAccount $RunAsDisplayName</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Choose a group by displayname.&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #This group contains Windows Computers objects for agent managed computers and for cluster virtual server names.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $DistComputerNames = Get-SCOMGroup -DisplayName $DistGroupName | Get-SCOMClassInstance | Select-Object -Property DisplayName</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Exit script and log error if group returns no valid instances of Windows Computer property displayname<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF ($DistComputerNames -eq $null)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Log an event that our script is ending in error<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write-EventLog &ndash;LogName &#39;Operations Manager&#39; &ndash;Source &ldquo;Health Service Script&rdquo; &ndash;EntryType Warning &ndash;EventID 3252&nbsp; &ndash;Message &ldquo;RunAs HealthService Distribution Script ended in error.&nbsp; The group ($DistGroupName) was not found or contained no objects!&rdquo;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />ELSE<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Set DistAgents to empty<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $DistAgents = @()</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Get an array of Health Service Objects which match the displayname of the group membership objects<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Foreach ($DistComputerName in $DistComputerNames)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $DistAgents += $HealthServiceClass | where {$_.DisplayName -eq $DistComputerName.DisplayName} <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF ($DistAgents -ne $null)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Compare lists (diff) to get a list of all Computers in the group that do not have a matching HealthService.&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Assume these are Network Name values for clustered resource groups<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $DistClusters = Compare-Object $DistComputerNames $DistAgents -Property DisplayName -PassThru<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ELSE<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Assume that the group only contained Windows Cluster objects and no agents.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $DistClusters = $DistComputerNames<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If there are no clusters in the group skip the cluster node section of the script<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF ($DistClusters.count -ge 1)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Set UknownObject array equal to null to ensure it is empty from any previous script runs<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $UnknownObjects = @()<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Get the relationship ID we need to find nodes that host a cluster<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $rid = Get-SCOMRelationship -DisplayName &#39;Health Service manages Entity&#39;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Get all Cluster virtual server class instances in an array<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $vsclass = Get-SCOMClass -name &#39;Microsoft.Windows.Cluster.VirtualServer&#39; | Get-scomclassinstance<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Create a loop to find the node names of each cluster and add those names to an array<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; foreach ($clname in $DistClusters)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Get the Virtual Server class instance for each cluster name<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $vs = $vsclass | where-object {$_.DisplayName -eq $clname}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Continue with the script if we got a match for a virtual server class<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF ($vs -ne $null)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Get the nodes in an array which have a health service relationship managing the virtual server cluster name<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $nodes = Get-SCOMRelationshipInstance -TargetInstance $vs | Where-Object {$_.relationshipid -eq $rid.id} | Select-Object -Property SourceObject<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Get an array of SCOM Agent objects which match the displayname of objects in the nodenames array and check first to ensure no duplicates<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Foreach ($node in $nodes)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If ($DistAgents -notcontains $node.SourceObject)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $DistAgents += $HealthServiceClass | where {$_.DisplayName -eq $node.SourceObject}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #If objects in the group do not match the displayname for a virtual server class nor a healthservice displayname add them to unknown objects array<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ELSE<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $UnknownObjects += $clname<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Get the current RunAs account distribution as it exists today and save it in an array<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Comment out this entire section if you want to ignore the current distribution and ONLY go with what it in the group<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $RunAsDistOld = (Get-SCOMRunAsDistribution $RunAs).securedistribution<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Check and see if there is at least one health service distribution defined - ignore if none found<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #If at least one distribution is found, check for duplicates then add non dupes to the DistAgents array<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF ($RunAsDistOld.count -ge 1)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Foreach ($RunAsOld in $RunAsDistOld)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF ($DistAgents.DisplayName -notcontains $RunAsOld.DisplayName)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $DistAgents += $RunAsOld<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $DistAgents = $DistAgents | sort-object -Property DisplayName -Unique</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Set (replace) the RunAs distribution list for the defined RunAs account to whatever we found in DistAgents<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set-SCOMRunAsDistribution ($RunAs) -MoreSecure -SecureDistribution $DistAgents</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Log event that script is complete, additional variables for logging purposes<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $RunAsName = $RunAs.Name<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $DistAgentsCount = $DistAgents.count<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $RunAsDistOldCount = $RunAsDistOld.count<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If ($UnknownObjects.Count -lt 1)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $UnknownObjects = &#39;NONE&#39;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Write-EventLog &ndash;LogName &#39;Operations Manager&#39; &ndash;Source &ldquo;Health Service Script&rdquo; &ndash;EntryType Information &ndash;EventID 3251&nbsp; &ndash;Message &ldquo;RunAs HealthService Distribution Script Complete. Account: $RunAsName, Configured $DistAgentscount Healthservice objects.&nbsp; Previously there were $RunAsDistOldcount objects configured.&nbsp; Unknown Objects identified: $UnknownObjects.&nbsp; Health service objects added: $DistAgents&rdquo;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }<br />}</p>
<p><span style="background-color:#ffff00;"><br /><br /><span style="background-color:#ffffff;"><span style="text-decoration:underline;"><strong>PUBLISHED DATA</strong></span>(Now this is not necessary, I just put this here so SCO can show me what is being added/exists):<br /></span></span>DistAgents -&gt; String -&gt; DistAgents<br />RusAsDistOld -&gt; String -&gt; RunAsDistOld<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/deploypub.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/deploypub.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/deploypub.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/deploypub.PNG" border="0" /></a></p>
<p><span style="text-decoration:underline;">NOW RENAME YOUR RUNBOOK AND OFF YOU GO!!!!</span></p>
<p><br />HERE IS SOME OF THE OUTPUT FROM MINE:<br />You can see that I have removed the SCORCH server from my Orchestrator Account and the RB will automatically added it back in for me.<br /><span style="background-color:#ff0000;">Removed:</span><br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/accountremoved.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/accountremoved.PNG"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/accountremoved.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/accountremoved.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/accountremoved.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/accountremoved.PNG" border="0" /></a><br /><br /><br /><span style="background-color:#ffff00;">SCO Added:</span><br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/accountremoved.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/accountremoved.PNG"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/accountbefore.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/accountbefore.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/accountbefore.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/accountbefore.PNG" border="0" /></a><br /><br />Runbook executes and output....you can see my output because I have logging turned on (<strong><em><span style="text-decoration:underline;"><span style="background-color:#ffff00;">ONLY RECOMMENDED FOR TROUBLESHOOTING PURPOSES AND INITIAL BUILD OF RB....DO NOT LEAVE TURNED ON!)</span></span></em></strong><br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/rbresults.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/rbresults.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/rbresults.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/rbresults.PNG" border="0" /></a><br /><br />After execution in SCO RB Server OpsMgr&nbsp;Event Log:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/accountbefore.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/accountbefore.PNG"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/Account%20Added.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/Account-Added.PNG"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/Account%20Added.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/Account-Added.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/Account%20Added.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/Account-Added.PNG" border="0" /></a><br /><br />When I have a BAD group it will stop on the Bad Group and log.&nbsp; Now this will be on the server that the runbook is executing(Just keep that in mind when troubleshooting):<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/BadGroup.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/BadGroup.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/BadGroup.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/BadGroup.PNG" border="0" /></a><br /><br /></p>
<p><strong><em>Disclaimer:</em></strong></p>
<p><strong><em>This example is provided &ldquo;AS IS&rdquo; with no warranty expressed or implied. Run at your own risk. The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of Microsoft.</em></strong></p>
<p><strong><em><span style="color:#ff0000;">**Always test in your lab first**&nbsp; Do this at your own risk!! The author will not be held responsible for any damage you incur when making these changes!</span></em></strong></p>
<div class="navigation-list-footer"></div>
<div class="post-tags">Please let me know how this goes for you.&nbsp; Kevin and I would love to hear!</div>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/9828/00/00/03/64/99/78/Account.csv" original-url="http://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-9828-00-00-03-64-99-78/Account.csv">Account.csv</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Using SCO to auto deploy SCOM RunAs Accounts!</title>
      <link>https://docs.microsoft.com/archive/blogs/scom_atlas/using-sco-to-auto-deploy-scom-runas-accounts</link>
      <pubDate>Fri, 22 May 2015 12:44:00 GMT</pubDate>
      <dc:creator><![CDATA[Matty T]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/scom_atlas/2015/05/22/using-sco-to-auto-deploy-scom-runas-accounts/</guid>
      <description><![CDATA[RunAs accounts can be very cumbersome and annoying if they have not been deployed correctly!&nbsp; I...]]></description>
      <content:encoded><![CDATA[<p>RunAs accounts can be very cumbersome and annoying if they have not been deployed correctly!&nbsp; I think any SCOM admin can agree with that.&nbsp; <br />Now there are other solutions out there like <a title="http://blogs.technet.com/b/kevinholman/archive/2015/05/03/automating-run-as-account-distribution.aspx" href="/b/kevinholman/archive/2015/05/03/automating-run-as-account-distribution.aspx" target="_blank">Kevin Holman&#39;s example</a>&nbsp;and <a title="https://matthewlong.wordpress.com/2013/01/25/scom-2012-update-run-as-account-distribution-via-powershell/" href="https://matthewlong.wordpress.com/2013/01/25/scom-2012-update-run-as-account-distribution-via-powershell/" target="_blank">Matthew Long&#39;s example</a> but I thought I would show how to use in SCORCH.&nbsp;<br /> In working with my customer the need was to not have to have manual intervention&nbsp;so I wrote up a&nbsp;runbook to let Orchestrator do this automatically.&nbsp;</p>
<p>First thing is we do get our alert, but this is what our runbook will key off of.<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/Alert.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/Alert.PNG"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/Alert.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/Alert.PNG"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/Alert.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/Alert.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/Alert.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x1200/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/Alert.PNG" border="0" /></a><br /><br />The reason for the above alert is because our SQL Monitoring Account Distribution List look like this<span style="background-color:#ffff00;"><strong><span style="text-decoration:underline;"><em> without</em> </span></strong></span>SERVICEMANAGER.Lab.com:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/AccountWOSP13DB.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/AccountWOSP13DB.PNG"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/AccountWOSP13DB.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/AccountWOSP13DB.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/AccountWOSP13DB.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/AccountWOSP13DB.PNG" border="0" /></a><br /><br /></p>
<p>Then from this we are able to set up our runbook to take care of the rest.<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/RB.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/RB.PNG"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/RB.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/RB.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/RB.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/RB.PNG" border="0" /></a></p>
<p><span style="color:#0000ff;text-decoration:underline;"><em><strong>1. GET MISSING CREDS ALERT</strong></em></span><br />Set up the Monitor alert activity as below:&nbsp;<br /><span style="text-decoration:underline;"><em><strong>Name</strong> </em></span>= <span style="background-color:#ffff00;">System Center Management Health Service Credentials Not Found Alert Message</span><br />Now I use an Updater to forward my alerts so the bottom part is not necessary for you unless you don&#39;t want it to go to ticket but still get picked up by SCO.<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/runbookstart.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/runbookstart.PNG"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/runbookstart.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/runbookstart.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/runbookstart.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/runbookstart.PNG" border="0" /></a></p>
<p>From this activity we will pick up any alerts that match the criteria like the one in the first screenshot once the resolution state is&nbsp;updated to Processed by SCORCH.&nbsp;<br /><br /><span style="color:#0000ff;text-decoration:underline;"><em><strong>2. GET SSID:</strong></em></span><br />Next we use the alert description to break apart the data&nbsp;and&nbsp;pull back the important piece for this to work:&nbsp;<span style="text-decoration:underline;"><strong>Account </strong><strong>SSID</strong></span>.&nbsp; <br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/Alertdesc.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/Alertdesc.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/Alertdesc.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/Alertdesc.PNG" border="0" /></a><br /><br />In our runbook we will utilize the&nbsp;<span style="text-decoration:underline;"><em>Run .NET Script activity</em> </span>for the next 3 activities and each will use PowerShell to execute the scripts below:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/SSID.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/SSID.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/SSID.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/SSID.PNG" border="0" /></a><br /><br /><strong><span style="text-decoration:underline;">SCRIPT:</span></strong><br />$string = <span style="background-color:#ffff00;">&#39;UPDATE TO POINT TO DESCRIPTION FROM PREVIOUS ACTIVITY&#39;</span><br />$string = $string.split([environment]::NewLine)<br />$s= $string | where{$_.contains(&#39;SSID:&#39;)}<br />$SSID = $s.Split(&#39;:&#39;)[1].Trim()<br /><br /><strong><span style="text-decoration:underline;">PUBLISHED DATA:</span></strong><br />SSID -&gt; String -&gt; SSID<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/SSIDPub.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/SSIDPub.PNG"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/SSIDPub.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/SSIDPub.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/SSIDPub.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/SSIDPub.PNG" border="0" /></a><br /><br /><br /><span style="color:#0000ff;">3. GET THE ACCOUNT</span><br />Next we need to get the actual account we need to add the computer to:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/getaccount.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/getaccount.PNG"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/getaccount.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/getaccount.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/getaccount.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/getaccount.PNG" border="0" /></a></p>
<p>Assistance from <span class="fn"><a title="http://blog.wouters.it/2011/02/scom-account-specified-in-run-as.html" href="http://blog.wouters.it/2011/02/scom-account-specified-in-run-as.html">Michiel Wouters blog</a> on how to decipher the SSID!</span><span style="text-decoration:underline;"><strong><br />SCRIPT:</strong><br /></span>#Import OM Module<br />Import-Module OperationsManager;<br />New-SCOMManagementGroupConnection <span style="background-color:#ffff00;">YOUR MGMT SERVER<br /></span><br /><br />$SSID = <span style="background-color:#ffff00;">&#39;CHANGE TO POINT TO SSID FROM PREVIOUS ACTIVITY&#39;</span><br />Get-SCOMRunAsAccount | Sort Name | % {$string = $null;$_.SecureStorageId | % { <br />&nbsp;$string = $string + &quot;{0:X2}&quot; -f $_}</p>
<p>[string]$RunAsAccountSSID = $string<br />if ($SSID -like $RunAsAccountSSID) <br />{$RunAsAccountName = $_.Name}<br />}</p>
<p><br /><strong><span style="text-decoration:underline;">PUBLISHED DATA:</span></strong><br />RunAsAccountName -&gt; String _&gt; RunAsAccountName<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/getaccountpublished.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/getaccountpublished.PNG"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/getaccountpublished.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/getaccountpublished.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/getaccountpublished.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/getaccountpublished.PNG" border="0" /></a><br /><br /><br /><span style="color:#0000ff;">4. ADD TO DISTRO LIST</span><br />From here we pass along the RunAs Account and get his current list if any&nbsp;and then we add&nbsp;the original alerting machine to the Account:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/AddAccount.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/AddAccount.PNG"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/AddAccount.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/AddAccount.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/AddAccount.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/AddAccount.PNG" border="0" /></a><br /><br /><span style="text-decoration:underline;"><strong>SCRIPT:</strong></span><br />Import-Module OperationsManager;<br />New-SCOMManagementGroupConnection <span style="background-color:#ffff00;">YOUR MGMT SERVER<br /><br /></span><br />$RAAccount = Get-SCOMRunAsAccount -name <span style="background-color:#ffff00;">&#39;UPDATE TO POINT TO RUNASACCOUNT FROM PREVIOUS ACTIVITY&#39;</span><br />$monitoringObjectId = get-SCOMMonitoringObject -Id <span style="background-color:#ffff00;">&#39;UPDATE TO POINT TO MONITORINGOBJECTID FROM MISSING HEALTH CRED ACTIVITY&#39;</span><br />$Group=&nbsp; $RAAccount.ManagementGroup<br />$connection = [Microsoft.SystemCenter.OperationsManagerV10.Commands.OMV10Utility]::GetConnectionForManagementGroup($Group)<br />$hsClass = $group.EntityTypes.GetClasses(&quot;Name = &#39;Microsoft.SystemCenter.Healthservice&#39;&quot;) |%{ $_ }<br />$poolClass = $group.EntityTypes.GetClasses(&quot;Name = &#39;Microsoft.SystemCenter.ManagementServicePool&#39;&quot;) |%{ $_ }<br />[Microsoft.EnterpriseManagement.Monitoring.MonitoringObject[]] $distributionList = @()<br />if (((Get-SCOMRunAsDistribution $RAAccount).securedistribution).count -ge &quot;1&quot;)<br />&nbsp;&nbsp;&nbsp; {$distributionList&nbsp; += (Get-SCOMRunAsDistribution $RAAccount).securedistribution<br />&nbsp;&nbsp;&nbsp; }<br />foreach($o in $monitoringObjectId)<br />&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp; if($destination = ($o -as [Microsoft.EnterpriseManagement.Administration.AgentManagedComputer]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $distributionList += $destination.HostedHealthservice<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp; elseif($destination = ($o -as [Microsoft.EnterpriseManagement.Administration.ManagementServer]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $distributionList += $destination.HostedHealthservice<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp; elseif($destination = ($o -as [Microsoft.EnterpriseManagement.Administration.ManagementServicePool]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $distributionList += ( Get-SCOMClassInstance -Id $destination.Id -ScSession $connection )<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp; elseif(($destination = ($o -as [Microsoft.EnterpriseManagement.Monitoring.MonitoringObject])) -and ($destination.IsInstanceOf($hsClass) -or $destination.IsInstanceOf($poolClass)))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $distributionList += $destination<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp; [Microsoft.SystemCenter.OperationsManagerV10.Commands.OMV10Utility]::ApproveRunasAccountForDistribution($Group, $RAAccount, $distributionList)<br />&nbsp;&nbsp; }<br /><br /><br />Once you have this setup and the runbook fires on the Alert you will see that once it is complete you will see all 4 steps as Green&nbsp;<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/completedRunbook.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/completedRunbook.PNG"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/completedRunbook.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/completedRunbook.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/completedRunbook.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/completedRunbook.PNG" border="0" /></a><br /><br />The Missing credentials alert is now closed by System due to account being distributed:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/Alertproperties.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/Alertproperties.PNG"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/Alertproperties.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/Alertproperties.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/Alertproperties.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/Alertproperties.PNG" border="0" /></a></p>
<p><br />New Updated Distribution list&nbsp;for SQL Monitoring Account:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/AccountWSP13DB.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/AccountWSP13DB.PNG"></a><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/AccountWSP13DB.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/AccountWSP13DB.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/AccountWSP13DB.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x550/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/AccountWSP13DB.PNG" border="0" /></a></p>
<p><strong><em>Disclaimer:</em></strong></p>
<p><strong><em>This example is provided &ldquo;AS IS&rdquo; with no warranty expressed or implied. Run at your own risk. The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of Microsoft.</em></strong></p>
<p><strong><em><span style="color:#ff0000;">**Always test in your lab first**&nbsp; Do this at your own risk!! The author will not be held responsible for any damage you incur when making these changes!</span></em></strong></p>
<p></p>]]></content:encoded>
    </item>
    <item>
      <title>Task to restart SCOM Health Service</title>
      <link>https://docs.microsoft.com/archive/blogs/scom_atlas/task-to-restart-scom-health-service</link>
      <pubDate>Thu, 21 May 2015 15:57:00 GMT</pubDate>
      <dc:creator><![CDATA[Matty T]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/scom_atlas/2015/05/21/task-to-restart-scom-health-service/</guid>
      <description><![CDATA[I know many of us have always wanted a task where you were able to restart the SCOM Health service...]]></description>
      <content:encoded><![CDATA[<p>I know many of us have always wanted a task where you were able to restart the SCOM Health service from the console.&nbsp; Unfortunately this doesn&#39;t exist...until now! :)</p>
<p>I have tried in other <a title="http://blogs.technet.com/b/scom_atlas/archive/2013/11/22/removing-multiple-mgs-from-your-dual-triple-quad-homed-agents.aspx" href="/b/scom_atlas/archive/2013/11/22/removing-multiple-mgs-from-your-dual-triple-quad-homed-agents.aspx" target="_blank">posts</a> to get this to work but I am sure as many of you know when you try to restart the service from a task it stops and never restarts.&nbsp; This became a problem when I was trying to automate changing Management Groups between servers, etc.&nbsp;</p>
<p>The issue is that you have to create a breakaway job from the task to allow it to one restart the service but 2. give you back data.&nbsp; So&nbsp;in&nbsp;working with a customer who had to do a lot of work on his DCs and restart their services and of course many of us don&#39;t have access to those servers.&nbsp; Well we do&nbsp;know from the from some of the built in monitors that they have recovery tasks to restart the service when they pass X threshold of Handle Count. So he actually broke out the script to get the Java script portion and I worked on getting it converted to a VBscript.&nbsp; <br /><br />Now you use this to do almost anything!</p>
<p>SCRIPT:</p>
<p><strong>dim objWMIService, objProcess, strCommand</strong><br /><strong>dim oShell, oShellEnv, strShell, computerName, oAPI</strong></p>
<p><strong>Set oShell = WScript.CreateObject(&quot;WScript.Shell&quot;)<br />Set oAPI = CreateObject(&quot;MOM.ScriptAPI&quot;)<br /></strong></p>
<p><strong>set oShellEnv = oShell.Environment(&quot;Process&quot;)</strong><br /><strong>computerName = oShellEnv(&quot;ComputerName&quot;)</strong></p>
<p><strong>strCommand = &quot;cmd /c net stop HealthService &amp; cmd /c net start HealthService&quot;</strong></p>
<p><strong>Set objWMIService = GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2&quot;)</strong></p>
<p><strong>Call oAPI.LogScriptEvent(&quot;SCOMTaskAgentRestart.vbs&quot;, 1001, 4, &quot;Attempting restart of SCOM Health Service on &quot; &amp; computerName &amp; &quot; initiated by user in console&quot;)</strong></p>
<p><strong>Set objProcess = objWMIService.Get(&quot;Win32_Process&quot;)</strong><br /><strong>Set objProgram = objProcess.Methods_( _</strong><br /><strong>&quot;Create&quot;).InParameters.SpawnInstance_</strong><br /><strong>objProgram.CommandLine = strCommand</strong></p>
<p><strong>Set strShell = objWMIService.ExecMethod( _</strong><br /><strong>&quot;Win32_Process&quot;, &quot;Create&quot;, objProgram)</strong></p>
<p><strong>WScript.echo &quot;Restarted SCOM Health Service on &quot; &amp; computerName</strong></p>
<p><span style="font-family:arial black,avant garde;font-size:x-small;">&nbsp;</span></p>
<p>To get this to work I created a new task and targeted the Windows Server class<br /><strong><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/task%201.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/task-1.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/task%201.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/task-1.PNG" border="0" /></a><br /><br /></strong></p>
<p>and pasted the script from above with no parameters:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/task%202.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/task-2.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/task%202.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/task-2.PNG" border="0" /></a><br /><strong><br /></strong></p>
<p>Now when I save and let it get pushed to all machines I can see it when I look in the windows computer view<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/task%20view.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/task-view.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/task%20view.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/task-view.PNG" border="0" /></a><br /><br /></p>
<p>Now to test I just select a machine and select the task<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/task%20start%20execute.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/task-start-execute.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/task%20start%20execute.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/task-start-execute.PNG" border="0" /></a><br /><br /></p>
<p>Output from the executed&nbsp;task. Yes, what you are assuming is correct.&nbsp; It will always show that it is successful, but the difference here is that the task actually completes and doesn&#39;t just spin never knowing if it actually finished.&nbsp;<br /> If it were to fail you would receive a Heartbeat issue(just something to keep in the back of your mind)&nbsp;:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/task%20result.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/task-result.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/task%20result.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/task-result.PNG" border="0" /></a><br /><br /><br />From the Task Status&nbsp;View in the console:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/task%20result%20task%20view.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/task-result-task-view.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/task%20result%20task%20view.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/task-result-task-view.PNG" border="0" /></a><br /><br />Now we go to the server to verify!&nbsp; We are looking for a 103, 102, and 105 event at 5:36:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/task%20result%20serverside.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/task-result-serverside.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/task%20result%20serverside.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/task-result-serverside.PNG" border="0" /></a><br /><br /><br />In later posts I will actually tie this into other tasks that I use for automation and call from Orchestrator!<br /><br /><br />Also, please feel free to leave ideas on how you think you can use this and tying it into other tasks to make the lives of us SCOM admins easier! :)</p>
<p><strong><em><br />Disclaimer:</em></strong></p>
<p><strong><em>This example is provided &ldquo;AS IS&rdquo; with no warranty expressed or implied. Run at your own risk. The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of Microsoft.</em></strong></p>
<p><strong><em><span style="color:#ff0000;">**Always test in your lab first**&nbsp; Do this at your own risk!! The author will not be held responsible for any damage you incur when making these changes!</span></em></strong></p>]]></content:encoded>
    </item>
    <item>
      <title>SCOM 2012 R2 UR6 is now released!!!</title>
      <link>https://docs.microsoft.com/archive/blogs/scom_atlas/scom-2012-r2-ur6-is-now-released</link>
      <pubDate>Tue, 28 Apr 2015 11:19:00 GMT</pubDate>
      <dc:creator><![CDATA[Matty T]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/scom_atlas/2015/04/28/scom-2012-r2-ur6-is-now-released/</guid>
      <description><![CDATA[Updates for Operations Manager in this release:


The &quot;Remove-DisabledClassInstance&quot;...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family:Calibri;"><span style="font-size:medium;">Updates for</span> </span>Operations Manager in this release:</p>
<ul>
<li>
<p><b>The &quot;Remove-DisabledClassInstance&quot; Windows PowerShell command times out without completing</b><br /> <br /> The cmdlet takes lots of time to complete in large SCOM installations and sometimes times out without completing its work. This is fixed by optimizing the query that is used for deletion.&nbsp;</p>
</li>
<li>
<p><b>Duplicate closed alerts</b><br /> <br /> The <b>Find</b>&nbsp;option in a message view sometimes gives results of the current search together with the results from previous searches. This occurs because of an update issue in the grid and is fixed so that values are displayed that correspond only to the current search.&nbsp;</p>
</li>
<li>
<p><b>Topology widget objects lose location when they are opened in a console that has a different locale and decimal format</b><br /> <br /> Topology widgets that are created in one locale but are viewed from another locale display an incorrect location because of the widget&#39;s inability to interpret locale-specific formatting. This issue is fixed, and users can now create and view topology widgets from different locales.</p>
</li>
<li>
<p><b>WebConsole Details widget does not display anything</b><br /> <br /> When you click a message in the Alert widget, the details of the message are not displayed in the details widget on WebConsole. This issue is fixed by fixing the XAML page of the details widget. The XAML page was preventing the data from being displayed on the page.</p>
</li>
<li>
<p><b>Top 10 Performance widgets (WebConsole) are sometimes empty</b><br /> <br /> The Top 10 Performance widgets (WebConsole) are sometimes empty because of a performance issue. This issue was fixed in Update Rollup 3 through an MPB file that requires a manual import. Because many users missed importing the MPB, a fix is included in this update rollup as an SQL query update.</p>
</li>
<li>
<p><b>Problem with decoding SCOM trace log files</b><br /> <br /> Sometimes Operations Manager trace logs do not decode but generate the error &quot;Unknown(X ): GUID=XXX (No Format Information found).&quot; This occurs because the latest TMF files that contain formatting information for the related traces are missing. All TMF files are updated to make sure that traces are formatted correctly.</p>
<p><span style="text-decoration:underline;"><span style="font-size:large;"><b>Unix/Linux Management Pack</b></span></span></p>
</li>
</ul>
<ul>
<li>
<p><b>JEE: WebLogic 12.1.3 servers on Linux or Solaris are not discovered</b><br /> <br /> WebLogic 12cR1 Rel3 Java Application Servers that are installed on Linux and Solaris are not discovered.<br /> <br /> <b>Note</b>&nbsp;The UNIX or Linux agent must be updated after you install the Management Pack update to resolve this issue.<br /> <br /> <b>Relevant log messages:</b><br /> <br /> /var/opt/microsoft/scx/scx.log</p>
<p>2015-02-04T15:28:18,797Z<br /> Trace [scx.core.common.pal.system.appserver.appserverenumeration:379:15739:139715041470400] Weblogic process does not contain the &#39;platform.home&#39; or &#39;weblogic.system.BootIdentityFile&#39; commandline argument.<br /> <br /> 2015-02-04T15:28:18,797Z<br /> Trace [scx.core.common.pal.system.appserver.appserverenumeration:462:15739:139715041470400] Merging previously known instances with current running processes</p>
<p>&nbsp;</p>
</li>
<li>
<p><b>In rare cases, lots of omiagent processes may be observed on a UNIX or Linux computer</b><br /> <br /> If a single instance of data that is returned by an OMI provider is larger than 64 kilobytes (KB), the omiagent process becomes unresponsive, and additional omiagent processes are created. This issue can occur on a managed UNIX- or Linux-based computer if a rule or monitor returns an instance of data larger than 64 KB. This is most likely to be seen when a custom shell command or script rules return lots of data in StdOut.<br /> <br /> <b>Note</b>&nbsp;After you upgrade the Operations Manager UNIX/Linux agent to the version that is contained in this Management Pack update, an instance that exceeds 64 KB will be truncated and will generate the following message in the scx.log file. You can use the log message to identify and change the workflow that is returning too much data.</p>
<p>ExecuteCommand: Exceeded maximum output size for provider (64k), output truncated. Monitoring will not be reliable! Command executed: &quot;</p>
<p>&nbsp;</p>
</li>
<li>
<p><b>The SSLv3 protocol cannot be disabled in OpenSSL as used by the UNIX and Linux agents</b><br /> <br /> With this update, you can now disable the SSLv3 protocol for the Operations Manager UNIX and Linux agents. You can do this&nbsp;by adding a property to omiserver.conf (/etc/opt/microsoft/scx/conf). If SSLv3 is disabled, the UNIX and Linux agent will reject connections that cannot be negotiated by using TLS encryption. If SSLv3 is enabled (this is the default configuration), SSLv3 will be used only if TLS encryption cannot be negotiated.<br /> <br /> <b>omiserver.conf options for configuration SSLv3</b></p>
<p>Collapse this tableExpand this table</p>
</li>
</ul>
<table style="width:100%;" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>Property</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>Description</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
</tr>
<tr>
<td valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>NoSSLv3=<i>true|false</i></p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
<td valign="top"><span style="font-family:Times New Roman;font-size:medium;"> </span>
<p>Enable/Disables use of SSLv3&nbsp;</p>
<span style="font-family:Times New Roman;font-size:medium;"> </span></td>
</tr>
</tbody>
</table>
<p><span style="font-family:Calibri;font-size:medium;"><a href="https://support.microsoft.com/en-us/kb/3051169"><span style="color:#0563c1;font-family:Calibri;font-size:medium;">https://support.microsoft.com/en-us/kb/3051169</span></a>&nbsp;</span></p>
<p></p>]]></content:encoded>
    </item>
    <item>
      <title>SCOM 2012 R2 UR4 is now released!!!</title>
      <link>https://docs.microsoft.com/archive/blogs/scom_atlas/scom-2012-r2-ur4-is-now-released</link>
      <pubDate>Tue, 28 Oct 2014 13:06:00 GMT</pubDate>
      <dc:creator><![CDATA[Matty T]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/scom_atlas/2014/10/28/scom-2012-r2-ur4-is-now-released/</guid>
      <description><![CDATA[UR4 is out and here are the fixes:
Issues that are fixed in this update rollup
Issue 1It takes...]]></description>
      <content:encoded><![CDATA[<p>UR4 is out and here are the fixes:</p>
<h3 id="tocHeadRef">Issues that are fixed in this update rollup</h3>
<h4 id="tocHeadRef"><b>Issue 1<br /></b>It takes many minutes for the <b>Microsoft.Windows.CheckNTServiceStateMonitorType</b>&nbsp;function to determine that the service is down.<br /><br /><b>Issue 2</b><br />An attempt to apply sensitivity rules fails, and you receive the following error message:</h4>
<div class="kb_errormsgbody">
<div class="kb_errorcontent">
<div class="errormsg">The monitoring configuration contains errors and cannot be applied. <br />Exception: System.ApplicationException: Attribute &#39;regexCompare&#39; is null<br />at Microsoft.EnterpriseManagement.Modules.Apm.LibraryConfigManager.Tools.XmlTools.GetMandatoryAttribute(String attributeName, XmlNode node)<br />at any attempt to apply sensitivity rules fails with the errorMicrosoft.EnterpriseManagement.Modules.Apm.LibraryConfigManager.Modules.ApmModule.Core.Actions.AgentHandlersConfig.HiddenRuleXmlDeserializer.Deserialize(XmlNode rowData)</div>
</div>
</div>
<p><br /><b>Issue 3</b><br />GSM locations are geotagged incorrectly on Map Widget.<br /><br /><b>Issue 4</b><br />The MonitoringHost.exe process issues too many calls to System Center Failover Clustering.<br /><br /><b>Issue 5</b><br />The re-synchronization of all managed entities from Operations Manager to the Operations Manager Data Warehouse database causes duplicate entries, and an exception that resembles the following is thrown:</p>
<div class="indent">
<div class="message">Data was written to the Data Warehouse staging area but processing failed on one of the subsequent operations.<br />Exception &#39;SqlException&#39;: Sql execution failed. Error 2627, Level 14, State 1, Procedure ManagedEntityChange, Line 367, Message: Violation of UNIQUE KEY constraint &#39;UN_ManagedEntityProperty_ManagedEntityRowIdFromDAteTime&#39;. Cannot insert duplicate key in object &#39;dbo.ManagedEntityProperty&#39;.</div>
</div>
<p><br /><b>Issue 6</b><br />If&nbsp;data is truncated and&nbsp;is in Terminal status to a workflow, event ID 31551 is logged, and an exception that resembles the following is thrown:<br />Failed to store data in the Data Warehouse. The operation will be retried.<br />Exception &#39;InvalidOperationException&#39;: The given value of type String from the data source cannot be converted to type nvarchar of the specified target column.<br />One or more workflows were affected by this. <br />Workflow name: Microsoft.SystemCenter.DataWarehouse.CollectAlertData</p>
<p><b>Issue 7</b><br />An arithmetic overflow error occurs, and an exception that resembles the following is thrown:<br />Data was written to the Data Warehouse staging area but processing failed on one of the subsequent operations.<br />Exception &#39;SqlException&#39;: Sql execution failed. Error 8115, Level 16, State 2, Procedure RelationshipChange, Line 180, Message: Arithmetic overflow error converting expression to data type int.</p>
<p><br /><b>Issue 8</b><br />You experience poor performance when Operations Manager searches for attributes. Additionally, when doing more than one search in a row, the cache file (momcache.mdb) keeps increasing.<br /><br /><b>Issue 9</b><br />SCX agent generates&nbsp;lots of warnings in the log file when a user is using Security-Enhanced Linux (SELinux).<br /><br /><b>Issue 10</b><br />By default, the Rpcimap monitor for Red Hat Enterprise Linux 6 is disabled.</p>]]></content:encoded>
    </item>
    <item>
      <title>Exchange 2013 Management Pack</title>
      <link>https://docs.microsoft.com/archive/blogs/scom_atlas/exchange-2013-management-pack</link>
      <pubDate>Tue, 28 Oct 2014 10:47:00 GMT</pubDate>
      <dc:creator><![CDATA[Matty T]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/scom_atlas/2014/10/28/exchange-2013-management-pack/</guid>
      <description><![CDATA[All,
GOOD NEWS!!!!!&nbsp;A new version of the SCOM Management Pack for Exchange 2013 is...]]></description>
      <content:encoded><![CDATA[<p>All,</p>
<p>GOOD NEWS!!!!!&nbsp;A new version of the SCOM Management Pack for Exchange 2013 is released!</p>
<p><a title="http://www.microsoft.com/en-us/download/details.aspx?id=39039" href="http://www.microsoft.com/en-us/download/details.aspx?id=39039" target="_blank">EXCHANGE 2013 Management Pack</a></p>
<p>This contains new performance rules and views here are some below to give an idea of what comes with:<br /><br /></p>
<h4><span style="font-family:Calibri;font-size:medium;">Collecting performance data for Microsoft Exchange Server 2013 components</span><span style="font-family:Calibri;font-size:medium;"> </span></h4>
<p><span style="font-family:Calibri;font-size:medium;">This Management Pack collects following performance metrics:</span></p>
<ul>
<li>
<p>Exchange 2013 Server</p>
<ul>
<li>
<p>Exchange 2013 Database: I/O Database Reads Average Latency (ms)</p>
</li>
<li>
<p>Exchange 2013 Database: I/O Database Writes Average Latency (ms)</p>
</li>
<li>
<p>Exchange 2013 Database: I/O Log Reads Average Latency (ms)</p>
</li>
<li>
<p>Exchange 2013 Database: I/O Log Writes Average Latency (ms)</p>
</li>
<li>
<p>Exchange 2013 Database: Page Fault Stalls/sec</p>
</li>
<li>
<p>Exchange 2013 Server: Average Disk sec/Read</p>
</li>
<li>
<p>Exchange 2013 Server: Average Disk sec/Write</p>
</li>
<li>
<p>Exchange 2013 Server: Disk Free Space (MB)</p>
</li>
<li>
<p>Exchange 2013 Server: Disk Reads/sec</p>
</li>
<li>
<p>Exchange 2013 Server: Disk Size (MB)</p>
</li>
<li>
<p>Exchange 2013 Server: Disk Writes/sec</p>
</li>
<li>
<p>Exchange 2013 Server: Transport Queue Database Size (MB)</p>
</li>
<li>
<p>Exchange 2013 Server: Client Connections Count</p>
</li>
<li>
<p>Exchange 2013 Server: ActiveSync Pending</p>
</li>
<li>
<p>Exchange 2013 Server: Avg. Authentication Latency (ms)</p>
</li>
<li>
<p>Exchange 2013 Server: E2E Deliver &lt;=90sec</p>
</li>
<li>
<p>Exchange 2013 Server: E2E Latency Percentile 95</p>
</li>
<li>
<p>Exchange 2013 Server: E2E Latency Send to External &lt;=90sec</p>
</li>
<li>
<p>Exchange 2013 Server: EWS Response Time (ms)</p>
</li>
<li>
<p>Exchange 2013 Server: LDAP Search Time (ms)</p>
</li>
<li>
<p>Exchange 2013 Server: Messages Received/sec</p>
</li>
<li>
<p>Exchange 2013 Server: Messages Sent/sec</p>
</li>
<li>
<p>Exchange 2013 Server: Outstanding Proxy Requests</p>
</li>
<li>
<p>Exchange 2013 Server: HTTP Proxy Failure Rate (%)</p>
</li>
<li>
<p>Exchange 2013 Server: HTTP Proxy Requests/sec</p>
</li>
<li>
<p>Exchange 2013 Server: Queues by Type Count</p>
</li>
<li>
<p>Exchange 2013 Server: Queue Length</p>
</li>
<li>
<p>Exchange 2013 Server: Requests/sec</p>
</li>
<li>
<p>Exchange 2013 Server: Avg RPC Latency (ms)</p>
</li>
<li>
<p>Exchange 2013 Server: SMTP Bytes Received/Sec</p>
</li>
<li>
<p>Exchange 2013 Server: SMTP Bytes Sent/Sec</p>
</li>
<li>
<p>Exchange 2013 Server: SMTP Connections (Current)</p>
</li>
<li>
<p>Exchange 2013 Server: Store Messages Submitted/sec</p>
</li>
<li>
<p>Exchange 2013 Server: System Total Memory (MB)</p>
</li>
<li>
<p>Exchange 2013 Server: CPU Utilization (%)</p>
</li>
<li>
<p>Exchange 2013 Server: Private Memory Size (MB)</p>
</li>
<li>
<p>Exchange 2013 Server: Private Memory Size (%)</p>
</li>
</ul>
</li>
<li>
<p>Exchange 2013 Windows Service</p>
<ul>
<li>
<p>Exchange 2013 Windows Service: CPU Utilization (%)</p>
</li>
<li>
<p>Exchange 2013 Windows Service: Pool Non Paged Memory Size (MB)</p>
</li>
<li>
<p>Exchange 2013 Windows Service: Pool Paged Memory Size (MB)</p>
</li>
<li>
<p>Exchange 2013 Windows Service: Private Memory Size (MB)</p>
</li>
<li>
<p>Exchange 2013 Windows Service: Private Memory Size (%)</p>
</li>
</ul>
</li>
<li>
<p>Exchange 2013 IIS Application Pool</p>
<ul>
<li>
<p>Exchange 2013 IIS App Pool: Active Requests</p>
</li>
<li>
<p>Exchange 2013 IIS App Pool: Private Memory Size (%)</p>
</li>
<li>
<p>Exchange 2013 IIS App Pool: CPU Utilization (%)</p>
</li>
<li>
<p>Exchange 2013 IIS App Pool: Pool Non Paged Memory Size (MB)</p>
</li>
<li>
<p>Exchange 2013 IIS App Pool: Pool Paged Memory Size (MB)</p>
</li>
<li>
<p>Exchange 2013 IIS App Pool: Private Memory Size (MB)</p>
</li>
</ul>
</li>
<li>
<p>Exchange 2013 Mailbox Database Copy</p>
<ul>
<li>
<p>Exchange 2013 Mailbox Database: Available Space (MB)</p>
</li>
<li>
<p>Exchange 2013 Mailbox Database: Index Size (MB)</p>
</li>
<li>
<p>Exchange 2013 Mailbox Database: I/O Database Reads Average Latency (ms)</p>
</li>
<li>
<p>Exchange 2013 Mailbox Database: I/O Database Writes Average Latency (ms)</p>
</li>
<li>
<p>Exchange 2013 Mailbox Database: I/O Log Reads Average Latency (ms)</p>
</li>
<li>
<p>Exchange 2013 Mailbox Database: I/O Log Writes Average Latency (ms)</p>
</li>
<li>
<p>Exchange 2013 Mailbox Database: Transaction Log Available Space (MB)</p>
</li>
<li>
<p>Exchange 2013 Mailbox Database: Transaction Log Size (MB)</p>
</li>
<li>
<p>Exchange 2013 Mailbox Database: Database Page Fault Stalls/sec</p>
</li>
<li>
<p>Exchange 2013 Mailbox Database: Database Size (MB)<span style="font-family:Calibri;font-size:medium;">&nbsp;</span><span style="font-family:Times New Roman;font-size:medium;"> </span></p>
</li>
</ul>
</li>
</ul>
<h4><span style="font-family:Calibri;font-size:medium;">Collecting performance data for Microsoft Exchange Server 2013 Organization</span><span style="font-family:Calibri;font-size:medium;"> </span></h4>
<p><span style="font-family:Calibri;font-size:medium;">This Management Pack defines several &ldquo;synthetic&rdquo; performance metrics which shows overall Exchange Organization performance. These metrics are calculated as an aggregation of performance values collected at Exchange Servers.</span></p>
<ul>
<li>
<p>Exchange 2013 Organization</p>
<ul>
<li>
<p>Exchange 2013 Organization Synthetic: Mailbox Count</p>
</li>
<li>
<p>Exchange 2013 Organization Synthetic: Client Connections Count</p>
</li>
<li>
<p>Exchange 2013 Organization Synthetic: E2E Deliver &lt;=90sec</p>
</li>
<li>
<p>Exchange 2013 Organization Synthetic: E2E Latency Send to External &lt;=90sec</p>
</li>
<li>
<p>Exchange 2013 Organization Synthetic: Mailbox Database Size (MB)</p>
</li>
<li>
<p>Exchange 2013 Organization Synthetic: Messages Received/sec</p>
</li>
<li>
<p>Exchange 2013 Organization Synthetic: Messages Sent/sec</p>
</li>
<li>
<p>Exchange 2013 Organization Synthetic: Store Messages Submitted/sec</p>
</li>
</ul>
</li>
</ul>
<p></p>]]></content:encoded>
    </item>
    <item>
      <title>SCOM 2012 R2 UR3 is out!!!</title>
      <link>https://docs.microsoft.com/archive/blogs/scom_atlas/scom-2012-r2-ur3-is-out</link>
      <pubDate>Tue, 29 Jul 2014 14:22:00 GMT</pubDate>
      <dc:creator><![CDATA[Matty T]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/scom_atlas/2014/07/29/scom-2012-r2-ur3-is-out/</guid>
      <description><![CDATA[Here is the link:
http://support.microsoft.com/kb/2965445

Here are the fixes:

A deadlock...]]></description>
      <content:encoded><![CDATA[<p>Here is the link:</p>
<p><a title="SCOM 2012 UR3" href="http://support.microsoft.com/kb/2965445" target="_blank">http://support.microsoft.com/kb/2965445</a></p>
<p></p>
<p>Here are the fixes:</p>
<ul>
<li>A deadlock condition occurs when a database is connected after an outage. You may experience this issue may when one or more HealthServices services in the environment are listed as&nbsp;<strong class="uiterm">Unavailable</strong> after a database goes offline and then comes back online.</li>
<li>The Desktop console crashes after exception TargetInvocationException occurs when the TilesContainer is updated. You may experience this issue after you leave the console open on a Dashboard view for a long time.</li>
<li>The Password expiration monitor is fixed for logged events.&nbsp;To make troubleshooting easier, this fix adds more detail to Event IDs 7019 and 7020 when they occur.</li>
<li>The Health service bounces because of high memory usage in the instance <b>MonitoringHost: leak MOMModules!CMOMClusterResource::InitializeInstance</b>. This issue may be seen as high memory usage if you&nbsp;examine monitoringhost.exe in Performance Monitor. Or, the Health service may restart every couple of days , depending on the load on the server.</li>
<li>The Health service crashes in Windows HTTP Services (WinHTTP) if the RunAs account is not read correctly.</li>
<li>Windows PowerShell stops working with System.Management.Automation.PSSnapInReader.ReadEnginePSSnapIns. You may see this issue&nbsp;as Event ID 22400 together with a description of &quot;Failed to run the Powershell script.&quot;</li>
<li>The <strong class="uiterm">PropertyValue</strong> column in the contextual details widget is unreadable in smaller widget sizes because the <strong class="uiterm">PropertyName</strong> column uses too much space.</li>
<li>The update threshold for monitor &quot;Health Service Handle Count Threshold&quot; is reset to 30,000. You can see this issue in the environment, and the Health Service Handle Count Threshold monitor is listed in the critical state.</li>
<li>An acknowledgement (ACK) is delayed by write collisions in MS queue when lots of data is sent from 1,000 agents.</li>
<li>The execution of the <b>Export-SCOMEffectiveMonitoringConfiguration</b> cmdlet fails with the error &quot;Subquery returned more than 1 value.&rdquo;</li>
<li>The <b>MOMScriptAPI.ReturnItems</b>&nbsp;method can be slow because a process race condition may occur when many items are returned, and the method may take two seconds between items. Scripts may run slowly in the System Center Operations Manager environment.</li>
<li>When you are in the console and click&nbsp;<strong class="uiterm">Authoring</strong>, click <strong class="uiterm">Management Pack</strong>, click <strong class="uiterm">Objects</strong>, and then click <strong class="uiterm">Attributes</strong>&nbsp;to perform a Find operation, the Find operations seems unexpectedly slow. Additionally, the Momcache.mdb file grows very large.</li>
<li>A delta synchronization times out on SQL operations with Event ID 29181.</li>
<li>Operations Manager grooms out the alert history before an alert is closed.</li>
<li>The time-zone settings are not added to a subscription when non-English display languages are set. Additionally, time stamps on alert notifications are inaccurate for the time zone.</li>
<li>Web Browser widget requires the protocol (http or https) to be included in the URL.</li>
<li>You cannot access MonitoringHost&#39;s TemporaryStoragePath within the PowerShell Module.</li>
<li>The <b>TopNEntitiesByPerfGet</b> stored procedure may cause an Operations Manager dashboard performance issue. This issue may occur when a dashboard is run together with multiple widgets. Additionally, you may receive the following error message after a time-out occurs:<br /><br />
<div class="indent">
<div class="kb_errormsgbody">
<div class="kb_errorcontent">
<div class="errormsg">[Error] :DataProviderCommandMethod.Invoke{dataprovidercommandmethod_cs370}( 000000000371AA78 )<br />An unknown exception was caught during invocation and will be re-wrapped in a DataAccessException. System.TimeoutException: The operation has timed out.<br />at Microsoft.EnterpriseManagement.Monitoring.DataProviders.RetryCommandExecutionStrategy.Invoke(IDataProviderCommandMethodInvoker invoker)<br />at Microsoft.EnterpriseManagement.Presentation.DataAccess.DataProviderCommandMethod.Invoke(CoreDataGateway gateWay, DataCommand command)</div>
</div>
</div>
</div>
</li>
</ul>]]></content:encoded>
    </item>
    <item>
      <title>Schedule SCOM Maintenance Mode with Orchestrator</title>
      <link>https://docs.microsoft.com/archive/blogs/scom_atlas/schedule-scom-maintenance-mode-with-orchestrator</link>
      <pubDate>Tue, 22 Apr 2014 06:33:00 GMT</pubDate>
      <dc:creator><![CDATA[Matty T]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/scom_atlas/2014/04/22/schedule-scom-maintenance-mode-with-orchestrator/</guid>
      <description><![CDATA[Hello,
I was working with a customer when the need to schedule their maintenance was brought...]]></description>
      <content:encoded><![CDATA[<p>Hello,</p>
<p>I was working with a customer when the need to schedule their maintenance was brought up.&nbsp; As we all know this is a very sore spot for SCOM that we cannot do!&nbsp; We had the great idea of using Orchestrator to do the dirty work for us as long as our customers filled out a CSV document (correctly :)).&nbsp;</p>
<p>In this blog post I will show you how to build that Maintenance Mode from CSV&nbsp;File runbook and also a secondary runbook that will query your database every 5 minutes to initiate the scheduled maintenance.</p>
<p><strong><span style="text-decoration:underline;">High-Level Steps</span></strong></p>
<p>1) Create Databases (one to store our scheduled Maintenance requests and the other for reporting).<br /> 2) Create File location that you will store the Template.csv and where your users will save their requests.<br /> 3) Create file location for the completed requests to be moved to.<br /> 4) Create MM from CSV file runbook (this can also be created to pull from SharePoint 2013)<br /> 5) Create the Schedule Maintenance Mode runbook<br /> 6) Test and release to your customers!</p>
<p><strong>=================================================</strong></p>
<p><span style="font-family:Calibri;font-size:medium;">Let&rsquo;s start!</span></p>
<ol>
<li>
<p>We first need to create our 2 Databases.&nbsp; You can always consolidate these into one but for my demo purposes I kept them separate.&nbsp; I did use the same script to create the tables on both databases so the tables are mimics of each other.</p>
</li>
</ol>
<p><span style="font-family:Calibri;font-size:medium;">Here is what my structure looks like:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/8053.DB%20Screenshot.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/8053.DB-Screenshot.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/8053.DB%20Screenshot.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/8053.DB-Screenshot.PNG" border="0" /></a><br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/6811.DB%20Screenshot%201.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/6811.DB-Screenshot-1.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/6811.DB%20Screenshot%201.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/6811.DB-Screenshot-1.PNG" border="0" /></a><br /> <br /> Script to create the table(if you do use 2 databases, just change the USE [location]:<br /> </span>USE [ScheduledMaintMode]</p>
<p><span style="font-size:xx-small;">GO</span></p>
<p><span style="font-size:xx-small;">&nbsp;/****** Object:&nbsp; Table [dbo].[MMInfo]&nbsp;&nbsp;&nbsp; Script Date: 4/21/2014 12:32:50 PM ******/</span></p>
<p><span style="font-size:xx-small;">SET ANSI_NULLS ON<br /></span><span style="font-size:xx-small;">GO</span><span style="font-size:xx-small;">&nbsp;<br /></span><span style="font-size:xx-small;">SET QUOTED_IDENTIFIER ON<br /></span><span style="font-size:xx-small;">GO</span><span style="font-size:xx-small;">&nbsp;<br /><br /></span><span style="font-size:xx-small;">CREATE TABLE [dbo].[MMInfo](<br /></span><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ServerName] [nvarchar](max) NOT NULL,<br /></span><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [StartDate] [date] NOT NULL,<br /></span><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [StartTime] [nvarchar](50) NOT NULL,<br /></span><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [Duration] [nvarchar](50) NOT NULL,<br /></span><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [RequestedBy] [nvarchar](max) NULL,<br /></span><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [RepeatSchedule] [nchar](10) NULL,<br /></span><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [NumberOfOccurences] [nchar](10) NULL,<br /></span><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [CompletedOn] [nchar](10) NULL<br /></span><span style="font-size:xx-small;">) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]<br /></span><span style="font-size:xx-small;">GO<br /></span><br /><span style="font-family:Calibri;font-size:medium;"> 2. Create our File locations.</span></p>
<p><span style="font-family:Calibri;"><span style="font-size:medium;">The first location will be where we are going to store our MaintMode_Template.csv and where our users will also drop their requests.&nbsp; We need to make sure and educate the users to open the template and <b>SAVE AS </b>MaintMode_[Their UserID].csv.&nbsp; Now in my lab I just created this path local to my SCORCH server but you can create this on a file share that everyone will have access to.<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/7848.File%20location%201.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/7848.File-location-1.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/7848.File%20location%201.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/7848.File-location-1.PNG" border="0" /></a><br /> <br /> 3.&nbsp; Now we need to create another location so that our completed files have a place for auditing.<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/3480.File%20location%202.PNG" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/3480.File-location-2.PNG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/3480.File%20location%202.PNG" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/3480.File-location-2.PNG" border="0" /></a><br /><br /> You can see from the image above that we move and rename the file Month_Day_Year_FileName.&nbsp; This allows us to see when it was run.<br /> </span><b><i><span style="text-decoration:underline;">RUNBOOK #1: CSV FILE MM</span></i></b></span></p>
<p>Now we have done the first 2 steps so we need to open up SCORCH and create our Maintenance Mode folder.&nbsp; Under this folder we will create 2 sub folders.&nbsp; <br />One for the CSV File Maintenance Mode runbook and the other for Scheduled Maintenance Mode.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/rb1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/rb1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/rb1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/rb1.png" border="0" /></a></p>
<p>In our CSV file MM we need to right click and create new runbook.&nbsp; When completed it will look like below:<br /><br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/rb2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/rb2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/rb2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/rb2.png" border="0" /></a></p>
<p>So let&rsquo;s dig in :) We start with our Monitor File Activity.&nbsp; This is located under the File Management folder on the right side.<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/monfile.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/monfile.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/monfile.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/monfile.png" border="0" /></a><br /> <br /> <b><span style="text-decoration:underline;">Monitor File</span></b>:<br /> Once you have this go ahead and drag onto our new Runbook.&nbsp; Double click it and set the parameters to mimic below:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/monfileproperties.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/monfileproperties.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/monfileproperties.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/monfileproperties.png" border="0" /></a><br />*We need to make sure that the relation in the filter says &ldquo;Does not match pattern&rdquo; and value = *Template*.&nbsp; <br />In doing this, it&nbsp;will allow us to always keep our Template in the location without ever getting picked up by the runbook and moved.<br /> <br /> Next we need to drag out the Run .Net Activity onto our screen so that we can parse the .csv data.&nbsp; This activity is located under the System Activities.&nbsp; To save time we will drag this icon on 5 times. ( it seems crazy but trust me ;) )<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/7774.dotnetactivities.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/7774.dotnetactivities.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/7774.dotnetactivities.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/7774.dotnetactivities.png" border="0" /></a><br /> <br /> Once you have dragged all of them out make them look like our parent image and connect them all up.&nbsp; To connect them on the right of the Monitor File activity in the runbook there will be a small arrow.&nbsp; Hover over this until your cursor becomes a cross, then click and connect the activities.&nbsp; This allows us to pull published data from anything connected in front of the selected activity.<br /> <br /> <b><span style="text-decoration:underline;">Process Initial Data</span></b>, we need to make sure the type is PowerShell (in fact all of the .Net Activities we use will be PowerShell).<br /> You will notice that $filepath has some nasty value, this is because it is published data from Monitor File activity.<br />&nbsp;<br /><span style="font-family:Calibri;font-size:x-small;">$FilePath= &#39;\`d.T.~Ed/{A122FD91-6B43-4C55-978D-85142E54D074}.FileName\`d.T.~Ed/&#39;<br /></span><span style="font-family:Calibri;font-size:x-small;">$Data = Import-CSV $FilePath <br /></span><span style="font-family:Calibri;font-size:x-small;">$Array = @()<br /></span><span style="font-family:Calibri;font-size:x-small;">ForEach ($agent in $Data) </span></p>
<p><span style="font-family:Calibri;font-size:x-small;">{<br /></span><span style="font-family:Calibri;font-size:x-small;">&nbsp;$ServerName = $agent.&#39;ServerName(FQDN)&#39;<br /></span><span style="font-family:Calibri;font-size:x-small;">&nbsp;$Starttime = $agent.&#39;StartTime(military &amp; 5 min increments)&#39;<br /></span><span style="font-family:Calibri;font-size:x-small;">&nbsp;$StartDate = $agent.&#39;StartDate(MM/DD/YYYY)&#39;<br /></span><span style="font-family:Calibri;font-size:x-small;">&nbsp;$Duration = $agent.&#39;Duration(mins)&#39;<br /></span><span style="font-family:Calibri;font-size:x-small;">$Repeat = $agent.&#39;Repeat(Yes or No)&#39;<br /></span><span style="font-family:Calibri;font-size:x-small;">$Type = $agent.&#39;Type&#39;<br /></span><span style="font-family:Calibri;font-size:x-small;">$Occurences = $agent.&#39;Number Of Occurences&#39;<br /></span><span style="font-family:Calibri;font-size:x-small;">$Owner = $agent.&#39;Requested By&#39;</span></p>
<p><span style="font-family:Calibri;font-size:x-small;">&nbsp;</span><span style="font-family:Calibri;font-size:x-small;">&nbsp;&nbsp;&nbsp; if($Starttime.ToLower() -ne &#39;now&#39;)</span></p>
<p><span style="font-family:Calibri;font-size:x-small;">&nbsp;&nbsp;&nbsp; {<br /></span><span style="font-family:Calibri;font-size:x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $RunNow = &#39;False&#39;<br /></span><span style="font-family:Calibri;font-size:x-small;">&nbsp;&nbsp;&nbsp; }<br /></span><span style="font-family:Calibri;font-size:x-small;">&nbsp;&nbsp;&nbsp; Else<br /></span><span style="font-family:Calibri;font-size:x-small;">&nbsp;&nbsp;&nbsp; {<br /></span><span style="font-family:Calibri;font-size:x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $RunNow = &#39;True&#39;<br /></span><span style="font-family:Calibri;font-size:x-small;">&nbsp;&nbsp;&nbsp; }<br /><br /></span><span style="font-family:Calibri;font-size:x-small;">&nbsp;&nbsp;&nbsp; $str = $ServerName +&quot;,&quot;+$StartDate+&quot;,&quot;+$Starttime+&quot;,&quot;+$Duration+&quot;,&quot;+$Repeat+&quot;,&quot;+$Type+&quot;,&quot;+$Occurences+&quot;,&quot;+$Owner+&quot;,&quot;+$RunNow<br /></span><span style="font-family:Calibri;font-size:x-small;">&nbsp;&nbsp;&nbsp; $Array += $str+&quot;;&quot;</span></p>
<p><span style="font-size:x-small;"><span style="font-family:Times New Roman;"> </span>}</span></p>
<p>&nbsp;The image should look like this:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/2703.proinitdata.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/2703.proinitdata.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/2703.proinitdata.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/2703.proinitdata.png" border="0" /></a><br /><br /> To reference published data from another activity, 1<sup>st</sup> they must be connected and 2<sup>nd</sup> you need to right click &agrave; subscribe &agrave; Published Data. This will by default pull the first connected activity, but just hit the drop down and you can pull from other activities as long as they are before the activity you&rsquo;re on.&nbsp; Also if you don&rsquo;t see some common data, check the &lsquo;Show common Published Data&rsquo;(this is the data we will use to rename your file):<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/6431.info.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/6431.info.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/6431.info.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/6431.info.png" border="0" /></a><br /> <br /> <br /> Once that is completed we need to publish some data from this activity that will be used down the road.<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/0268.proinitdatapub.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/0268.proinitdatapub.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/0268.proinitdatapub.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/0268.proinitdatapub.png" border="0" /></a><br /> <br /> <br /> Now before we move to the next .Net Activity which is Agent Validation, we need to move our file and rename it:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/2620.move1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/2620.move1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/2620.move1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/2620.move1.png" border="0" /></a><br /><br /> These are located under the same folder as Monitor File.&nbsp; We just need to drag them onto our runbook and connect them similar to above.&nbsp; As for the parameters<br /> <b><span style="text-decoration:underline;">Move the MM File</span></b>:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/5125.move2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/5125.move2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/5125.move2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/5125.move2.png" border="0" /></a></p>
<p><b><span style="text-decoration:underline;">Rename the File</span></b> ( all I have done is right click the Destination properties and hit expand allowing for much easier editing/modifing):<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/move3.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/move3.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/move3.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/move3.png" border="0" /></a><br /> <br /> Now let&rsquo;s get back to Agent Validation Activity.&nbsp; This is where we will validate the data the user entered is correct and also has a SCOM agent on it.&nbsp; Here you use the Exchange integration pack to notify the User and SCOM team that there are boxes that are either incorrectly entered or don&rsquo;t have a SCOM agent. <br /> <b><span style="text-decoration:underline;">Agent Validation</span></b>:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/AVProperties1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/AVProperties1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/AVProperties1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/AVProperties1.png" border="0" /></a><br /><br /> Script( you will need to modify the SCOM connection to your Mgmt. Server!!!):<br /> <span style="font-size:xx-small;">#Import OM Module</span><br /><span style="font-size:xx-small;">Import-Module OperationsManager;</span><br /><span style="font-size:xx-small;">New-SCOMManagementGroupConnection [mgmt. server here]</span></p>
<p><span style="font-size:xx-small;">$ValidArray = @()</span><br /><span style="font-size:xx-small;">$BadServerArray = @()</span></p>
<p><span style="font-size:xx-small;">$Servers = &#39;\`d.T.~Ed/{BB1A40F6-93D4-45FE-AB52-2A9DF8065A24}.Array\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">$Agents = $Servers.Split(&#39;;&#39;)</span><br /><span style="font-size:xx-small;">foreach ($line in $Agents)</span><br /><span style="font-size:xx-small;">{</span><br /><span style="font-size:xx-small;">If (![string]::IsNullOrEmpty($line))</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-size:xx-small;">$line = $line.Trim()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><br /><span style="font-size:xx-small;">$processsplit = $line.split(&#39;,&#39;)</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $servername = $processsplit[0].Trim()</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $validAgent = (get-scomagent| where {$_.Displayname -eq $servername}).Displayname</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If (![string]::IsNullOrEmpty($servername))</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ($validAgent -match $servername)</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $ValidArray += $line</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $BadServerArray += $line</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-size:xx-small;">}</span><br /> <br /> Publish Data:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/AVProperties2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/AVProperties2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/AVProperties2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/AVProperties2.png" border="0" /></a><br /> <br /> <b><span style="text-decoration:underline;">Process Valid Agents</span></b>, this where we will break apart our Good Array and use this data to either kick off immediately or schedule.<br /> Details: <br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/PVA1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/PVA1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/PVA1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/PVA1.png" border="0" /></a><br /> <br /> Downside is we now need to publish all of this :(</p>
<p>Published Data: <br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/PVA2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/PVA2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/PVA2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/PVA2.png" border="0" /></a><br /> <br /> Nice!&nbsp; Now the majority of the hard work is done!&nbsp; Now we need to connect the Maintenance Mode activity from the SCOM IP.&nbsp; <br />Locate this and drag onto the runbook and connect to Process Valid Agents. For this connector we need to add some criteria!<br /> <br /> To do this we need to double click on the connecting line between the 2 activities and add our own criteria: <br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/criteria1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/criteria1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/criteria1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/criteria1.png" border="0" /></a><br /> <br /> <b><span style="text-decoration:underline;">Start MM </span></b>activity<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/startMM.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/startMM.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/startMM.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/startMM.png" border="0" /></a><br />*You need to make sure your Monitor field is like above. If not then Run Now MM will never work :(*&nbsp;&nbsp;<br /> Format:<br /> <span style="background-color:#ffff00;">{ServerName from &ldquo;Process Valid Agents&rdquo;} : Microsoft.Windows.Computer:{ServerName from &ldquo;Process Valid Agents&rdquo;}&nbsp;</span> --&gt;<b><i><span style="color:#ff0000;">NOTICE WHERE THERE ARE SPACES AND NOT!!!!</span><br /> <br /></i></b>In my example I have this going to the Event Log, this is just another form of auditing you can apply.&nbsp; Have SCOM alert so that you can report on it later when it finds MM events.<br /> <br /> OK, now on to the one off scheduling.&nbsp; This is just for I need Server A to go into Maintenance Mode next week and that is all.&nbsp; We first need to get the Write to DB activity from Utilities.<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/write%20to%20db.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/write-to-db.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/write%20to%20db.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/write-to-db.png" border="0" /></a><br /> <br /> Drag this icon onto the runbook twice and connect like below:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/write%20to%20db2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/write-to-db2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/write%20to%20db2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/write-to-db2.png" border="0" /></a><br /> <br /> On the connector from Process Valid Agents to Schedule Maintenance Mode it needs to have this criteria in the Include:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/criteria2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/criteria2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/criteria2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/criteria2.png" border="0" /></a><br /> <br /> Exclude:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/criteria3.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/criteria3.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/criteria3.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/criteria3.png" border="0" /></a><br /> <br /> We are doing to make sure that we are excluding our agents that need to have schedules setup.&nbsp;</p>
<p><br /> <b><span style="text-decoration:underline;">Schedule Maintenance Mode</span></b> Activity:<br /> Details:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/scheduleMM1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/scheduleMM1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/scheduleMM1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/scheduleMM1.png" border="0" /></a><br /> <br /> Connection tab:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/scheduleMM2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/scheduleMM2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/scheduleMM2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/scheduleMM2.png" border="0" /></a><br />*You will need to modify the Server field to match where you created your DB(s) in the earlier steps.*&nbsp;<br /> <span style="background-color:#ffff00;">**Also make sure that you gave your SCORCH service rights to the DB, because in the next runbook he will be creating, deleting, and moving records!**</span><br /> <br /> Now let&rsquo;s move to the recurring schedule portion of our runbook.&nbsp; Here we are offering the users the option of daily, weekly, or monthly and in that last .Net Activity you will see the PowerShell we are using to accomplish this. First we need to start with the connector:<br /> Include:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/criteria4.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/criteria4.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/criteria4.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/criteria4.png" border="0" /></a></p>
<p>Exclude:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/criteria5.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/criteria5.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/criteria5.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/criteria5.png" border="0" /></a><br /> <br /> <b><span style="text-decoration:underline;">Create Schedule</span></b> Activity:<br /> Details:<br /> <br /> <br /> Script:<br /> <span style="font-size:xx-small;">$StartDate = &#39;\`d.T.~Ed/{73B75251-B48E-45E8-B5D8-1B6DEC647D63}.StartDate\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">$strdate = get-date $StartDate</span><br /><span style="font-size:xx-small;">$Type = &#39;\`d.T.~Ed/{73B75251-B48E-45E8-B5D8-1B6DEC647D63}.Type\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">$Occurences = &#39;\`d.T.~Ed/{73B75251-B48E-45E8-B5D8-1B6DEC647D63}.Occurences\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">$Servername = &#39;\`d.T.~Ed/{73B75251-B48E-45E8-B5D8-1B6DEC647D63}.Servername\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">$StartTime = &#39;\`d.T.~Ed/{73B75251-B48E-45E8-B5D8-1B6DEC647D63}.StartTime\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">$Owner = &#39;\`d.T.~Ed/{73B75251-B48E-45E8-B5D8-1B6DEC647D63}.Owner\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">$Duration = &#39;\`d.T.~Ed/{73B75251-B48E-45E8-B5D8-1B6DEC647D63}.Duration\`d.T.~Ed/&#39;</span></p>
<p><span style="font-size:xx-small;">$array = @()</span></p>
<p><span style="font-size:xx-small;">If($Type -eq &#39;Daily&#39;)</span><br /><span style="font-size:xx-small;">{</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp; $NewDate = $strdate</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp; if ($Occurences -gt &#39;1&#39;)</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $str = $Servername +&quot;,&quot;+($NewDate).ToShortDateString()+&quot;,&quot;+$Starttime+&quot;,&quot;+$Duration+&quot;,&quot;+$Type+&quot;,&quot;+$Occurences+&quot;,&quot;+$Owner</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Array += $str +&quot;;&quot;</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2..$Occurences | foreach-object{`</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NewDate =$NewDate.AddDays(1)</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Arraydate = $NewDate.ToShortDateString()</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $str = $Servername +&quot;,&quot;+$Arraydate+&quot;,&quot;+$Starttime+&quot;,&quot;+$Duration+&quot;,&quot;+$Type+&quot;,&quot;+$Occurences+&quot;,&quot;+$Owner</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Array += $str +&quot;;&quot;</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-size:xx-small;">}</span></p>
<p><span style="font-size:xx-small;">If($Type -eq &#39;Weekly&#39;)</span><br /><span style="font-size:xx-small;">{</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp; $NewDate = $strdate</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp; if ($Occurences -gt &#39;1&#39;)</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $str = $Servername +&quot;,&quot;+($NewDate).ToShortDateString()+&quot;,&quot;+$Starttime+&quot;,&quot;+$Duration+&quot;,&quot;+$Type+&quot;,&quot;+$Occurences+&quot;,&quot;+$Owner</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Array += $str +&quot;;&quot;</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2..$Occurences | foreach-object{`</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NewDate =$NewDate.AddDays(7)</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Arraydate = $NewDate.ToShortDateString()</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $str = $Servername +&quot;,&quot;+$Arraydate+&quot;,&quot;+$Starttime+&quot;,&quot;+$Duration+&quot;,&quot;+$Type+&quot;,&quot;+$Occurences+&quot;,&quot;+$Owner</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Array += $str +&quot;;&quot;</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-size:xx-small;">}&nbsp;</span></p>
<p><span style="font-size:xx-small;">If ($Type -eq &#39;Monthly&#39;)</span><br /><span style="font-size:xx-small;">{</span><br /><span style="font-size:xx-small;">$NewDate = $strdate</span><br /><span style="font-size:xx-small;">$DOW = $strdate.DayOfWeek</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp; if ($Occurences -gt &#39;1&#39;)</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $str = $Servername +&quot;,&quot;+($NewDate).ToShortDateString()+&quot;,&quot;+$Starttime+&quot;,&quot;+$Duration+&quot;,&quot;+$Type+&quot;,&quot;+$Occurences+&quot;,&quot;+$Owner</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Array += $str +&quot;;&quot;</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2..$Occurences | foreach-object{`</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NewDate =$NewDate.AddMonths(1)</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if($NewDate.DayOfWeek -ne $strdate.DayOfWeek)</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $n = 0</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do{</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NDate = $NewDate.AddDays($n)</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $n++}</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Until ($NDate.DayOfWeek -eq $DOW)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(($nDate.Day - $strdate.Day) -gt &#39;5&#39;)</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $n = 0</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do{</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $NDate = $NewDate.AddDays(-$n)</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $n++}</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Until ($NDate.DayOfWeek -eq $DOW)</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Arraydate = $NDate.ToShortDateString()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p>
<p><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $str = $Servername +&quot;,&quot;+$Arraydate+&quot;,&quot;+$Starttime+&quot;,&quot;+$Duration+&quot;,&quot;+$Type+&quot;,&quot;+$Occurences+&quot;,&quot;+$Owner</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $Array += $str +&quot;;&quot;</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-size:xx-small;">&nbsp;&nbsp;&nbsp; }</span><br /><span style="font-size:xx-small;">}</span><br /> <br /> Published Data:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/createschedule2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/createschedule2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/createschedule2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/createschedule2.png" border="0" /></a></p>
<p><b><span style="text-decoration:underline;">Process Scheduled Jobs</span></b> Activity:<br /> Details:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/processjobs1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/processjobs1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/processjobs1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/processjobs1.png" border="0" /></a><br /> <br /> Script:<br /> <span style="font-size:xx-small;">$process = &#39;\`d.T.~Ed/{1B802AEB-4D49-4DFB-8C43-7FC61CE93400}.array\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">$processsplit = $process.split(&#39;,&#39;)</span><br /><span style="font-size:xx-small;">$servername = $processsplit[0]</span><br /><span style="font-size:xx-small;">$StartDate = $processsplit[1]</span><br /><span style="font-size:xx-small;">$StartTime = $processsplit[2]</span><br /><span style="font-size:xx-small;">$Duration = $processsplit[3]</span><br /><span style="font-size:xx-small;">$Type = $processsplit[4]</span><br /><span style="font-size:xx-small;">$Occurences = $processsplit[5]</span><br /><span style="font-size:xx-small;">$Owner = $processsplit[6]</span><br /><span style="font-size:xx-small;">if ($Owner -match &quot;;&quot;)</span><br /><span style="font-size:xx-small;">{</span><br /><span style="font-size:xx-small;">$Owner = $Owner.Replace(&quot;;&quot;,&quot;&quot;)</span><br /><span style="font-size:xx-small;">}</span><br /> <br /> Published Data:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/processjobs2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/processjobs2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/processjobs2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/processjobs2.png" border="0" /></a><br /> <br /> Now the very last activity of the CSV File MM runbook, :)!!!<br /> <br /> <b><span style="text-decoration:underline;">Schedule Future MM</span></b> Activity:</p>
<p>Details: <br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/scheduleFuture1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/scheduleFuture1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/scheduleFuture1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/scheduleFuture1.png" border="0" /></a><br /> <br /> Connection tab:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/scheduleFuture2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/scheduleFuture2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/scheduleFuture2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/scheduleFuture2.png" border="0" /></a><br />*Make sure to modify for your SQL Server from the first step.*<br /> <br /> <br /> <b><i><span style="text-decoration:underline;">RUNBOOK #2: SCHEDULED MAINT. MODE</span></i></b><br /> Overview of runbook: <br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/rb3.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/rb3.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/rb3.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/rb3.png" border="0" /></a><br /> <br /> For this runbook we will run on a 5 minute interval as we don&rsquo;t want to overwhelm our SCORCH instance and also the SCOM instance.&nbsp; We need to start with the Monitor Date/Time Activity. This activity will be located under Scheduling.<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/montime1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/montime1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/montime1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/montime1.png" border="0" /></a></p>
<p><b><span style="text-decoration:underline;">5 Min. Interval</span></b> Activity:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/montime2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/montime2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/montime2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/montime2.png" border="0" /></a><br /> <br /> We now need to get the Query Database activity under the same location as the Write to Database activity.&nbsp; Drag this activity to your runbook and connect the 2 activities. <br />We will also need to drag 3 more of them for activities like you see in the main screen shot.<br /> <br /> <b><span style="text-decoration:underline;">Query Database</span></b> Activity: <br /> Details: <br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/qdb1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/qdb1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/qdb1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/qdb1.png" border="0" /></a><br /> <br /> Query: <br /> <span style="font-size:xx-small;">select ServerName, Duration, StartTime,StartDate,RequestedBy from MMInfo</span><br /><span style="font-size:xx-small;">where StartDate like (SELECT FORMAT(CURRENT_TIMESTAMP, &#39;yyyy-MM-dd&#39;))</span><br /><span style="font-size:xx-small;">and StartTime Between (SELECT FORMAT(CURRENT_TIMESTAMP, &#39;HH:mm&#39;)) and DATEADD(MINUTE, 5, (SELECT FORMAT(CURRENT_TIMESTAMP, &#39;HH:mm&#39;)))</span><br /> <br /> Connection tab:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/qdb2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/qdb2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/qdb2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/qdb2.png" border="0" /></a><br /> *Be sure to adjust for your SQL Server<br /> <br /> Next we need to drag a Run .Net Activity to our runbook and connect it from the Query Database activity. We are also going to be adding some criteria to the connector to stop the run book if no rows are returned from our query.<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/criteria6.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/criteria6.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/criteria6.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/criteria6.png" border="0" /></a><br /><br /><b><span style="text-decoration:underline;">Process Query Results</span></b> Activity:<br /> Details:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/procqr1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/procqr1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/procqr1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/procqr1.png" border="0" /></a><br /> <br /> Script:<br /> <span style="font-size:xx-small;">$process = &#39;\`d.T.~Ed/{6BEF2F48-9A68-41D1-A1C1-E3A16B6C10A5}.Full-line\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">$processsplit = $process.split(&#39;;&#39;)</span><br /><span style="font-size:xx-small;">$servername = $processsplit[0]</span><br /><span style="font-size:xx-small;">$Duration = $processsplit[1]</span><br /><span style="font-size:xx-small;">$StartTime = $processsplit[2]</span><br /><span style="font-size:xx-small;">$StartDate = $processsplit[3]</span><br /><span style="font-size:xx-small;">$RequestedBy = $processsplit[4]</span></p>
<p>&nbsp;<br /> Published Data:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/procqr2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/procqr2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/procqr2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/procqr2.png" border="0" /></a><br /> <br /> Now we have broken apart all the data from our query and we need to not only move it to our completed from scheduled db but also kick off Maintenance Mode!!!&nbsp; Kind of the whole reason you&rsquo;re hereJ!!!<br /> <br /> <b><span style="text-decoration:underline;">Start Maintenance Mode</span></b> Activity: <br /> Details:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/startMM1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/startMM1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/startMM1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/startMM1.png" border="0" /></a><br /> *Once again just like in the other runbook you need to be very cautious of the Monitor field.&nbsp; If this isn&rsquo;t right you will never start MM on your agents.<br /> **You will also see two other activities coming off of Start Maintenance Mode, these are just extra steps for notifying that MM has started and auditing.</p>
<p><b><span style="text-decoration:underline;">Update MM Tables</span></b> Activity:<br /> This activity will be used to move the selected rows from Scheduled to Completed DBs.<br /> Details:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/update1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/update1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/update1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/update1.png" border="0" /></a><br /> *If you used only one DB for your tables make sure you account for that in our activities!<br /> <br /> Script: <br /> <span style="font-size:xx-small;">Insert into [CompletedMaintMode].[dbo].[MMInfo]</span><br /><span style="font-size:xx-small;">Select *from MMInfo</span><br /><span style="font-size:xx-small;">where StartDate = &#39;\`d.T.~Ed/{EF99E84D-DEEE-442F-8B11-C468131532E9}.StartDate\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">and StartTime = &#39;\`d.T.~Ed/{EF99E84D-DEEE-442F-8B11-C468131532E9}.StartTime\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">and ServerName = &#39;\`d.T.~Ed/{EF99E84D-DEEE-442F-8B11-C468131532E9}.servername\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">and Duration = &#39;\`d.T.~Ed/{EF99E84D-DEEE-442F-8B11-C468131532E9}.Duration\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">and RequestedBy = &#39;\`d.T.~Ed/{EF99E84D-DEEE-442F-8B11-C468131532E9}.RequestedBy\`d.T.~Ed/&#39;</span><br /> <br /> Connection Tab:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/update2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/update2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/update2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/update2.png" border="0" /></a><br /> <br /> We need to move onto the Update Completed.&nbsp; This activity will update our rows notifying us for our reports when the MM was actually executed.<br /> <br /> <b><span style="text-decoration:underline;">Update Completed</span></b> Activity:<br /> Details:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/3554.update1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/3554.update1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/3554.update1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/3554.update1.png" border="0" /></a><br /> <br /> Script:<br /><span style="font-size:xx-small;"> Update [CompletedMaintMode].[dbo].[MMInfo]</span><br /><span style="font-size:xx-small;">set [CompletedMaintMode].[dbo].[MMInfo].CompletedOn = (SELECT FORMAT(CURRENT_TIMESTAMP, &#39;yyyy-MM-dd&#39;))</span><br /><span style="font-size:xx-small;">where StartDate = &#39;\`d.T.~Ed/{EF99E84D-DEEE-442F-8B11-C468131532E9}.StartDate\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">and StartTime = &#39;\`d.T.~Ed/{EF99E84D-DEEE-442F-8B11-C468131532E9}.StartTime\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">and ServerName = &#39;\`d.T.~Ed/{EF99E84D-DEEE-442F-8B11-C468131532E9}.servername\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">and Duration = &#39;\`d.T.~Ed/{EF99E84D-DEEE-442F-8B11-C468131532E9}.Duration\`d.T.~Ed/&#39;</span><br /><span style="font-size:xx-small;">and RequestedBy = &#39;\`d.T.~Ed/{EF99E84D-DEEE-442F-8B11-C468131532E9}.RequestedBy\`d.T.~Ed/&#39;</span><br /> <br /> Connection:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/0268.update2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/0268.update2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/0268.update2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/0268.update2.png" border="0" /></a><br /> <br /> Now that we have updated our completed we can now delete all completed records from our Scheduled DB.&nbsp; This will keep it clean and hopefully minimize any confusion for users, reporting, etc.<br /> <br /> <b><span style="text-decoration:underline;">Delete from ScheduledMM</span></b> Activity:<br /> Details:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/delete1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/delete1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/delete1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/delete1.png" border="0" /></a><br /> <br /> Script:<br /> <span style="font-size:xx-small;">Delete from MMInfo<br /></span><span style="font-size:xx-small;">where StartDate = &#39;\`d.T.~Ed/{EF99E84D-DEEE-442F-8B11-C468131532E9}.StartDate\`d.T.~Ed/&#39;<br /></span><span style="font-size:xx-small;">and StartTime = &#39;\`d.T.~Ed/{EF99E84D-DEEE-442F-8B11-C468131532E9}.StartTime\`d.T.~Ed/&#39;<br /></span><span style="font-size:xx-small;">and ServerName = &#39;\`d.T.~Ed/{EF99E84D-DEEE-442F-8B11-C468131532E9}.servername\`d.T.~Ed/&#39;<br /></span><span style="font-size:xx-small;">and Duration = &#39;\`d.T.~Ed/{EF99E84D-DEEE-442F-8B11-C468131532E9}.Duration\`d.T.~Ed/&#39;<br /></span><span style="font-size:xx-small;">and RequestedBy = &#39;\`d.T.~Ed/{EF99E84D-DEEE-442F-8B11-C468131532E9}.RequestedBy\`d.T.~Ed/&#39;</span></p>
<p>Connection:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/delete2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/delete2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/delete2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/delete2.png" border="0" /></a><br /> <br /> <br /> 7. Validation time!!!<br /> <br /> Create my file:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/file.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/file.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/file.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/file.png" border="0" /></a></p>
<p>Drop onto my scheduled folder and watch the completed to see it working :)<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/Completedfile.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/Completedfile.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/Completedfile.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/Completedfile.png" border="0" /></a><br /> <br /> <br /> Now I look back at the runbook and I see happiness:<br /> <a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/Completedrb.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/Completedrb.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/Completedrb.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/Completedrb.png" border="0" /></a><br /> <br /> Now let&rsquo;s check the database to see our schedule!<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/scheduleddb1.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/scheduleddb1.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/scheduleddb1.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/scheduleddb1.png" border="0" /></a></p>
<p>I will modify one of the rows to be today and start at 3:58PM<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/scheduleddb2.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/scheduleddb2.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/scheduleddb2.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/scheduleddb2.png" border="0" /></a></p>
<p>Verify that that my server isn&rsquo;t in Maintenance Mode before job kicks off:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/maintver.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/maintver.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/maintver.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/maintver.png" border="0" /></a></p>
<p><br /> Back to the Scheduled Maint. Mode runbook and watch for the 3:55 job run and pick it up.<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/rb4.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/rb4.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/rb4.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/rb4.png" border="0" /></a><br />&nbsp;<br /> So we see it was picked up from the 3:55 job so let&rsquo;s check the DB again.<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/3.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/3.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/3.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/3.png" border="0" /></a><br />Only 3 rows!!</p>
<p>Now we can check the Completed table:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/CompletedDB.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/CompletedDB.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/CompletedDB.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/CompletedDB.png" border="0" /></a>&nbsp;</p>
<p>Now back to SCOM to validate!!!<br /> As you can see the time difference is 40 minutes and the comment matches exactly what we have for our Maintenance Mode activities:<br /><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/final.png" original-url="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/final.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/98/28/final.png" original-url="http://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-98-28/final.png" border="0" /></a></p>
<p>Now this is just the Ford Pinto of how to schedule maintenance mode, you can always use <a title="http://www.scom2k7.com/scom-2012-maintenance-mode-scheduler/" href="http://www.scom2k7.com/scom-2012-maintenance-mode-scheduler/">Tim McFadden&#39;s </a>Cadillac version which is VERY nice!!!</p>
<p>I am always open to hearing about how you do it at your company or if you think there are ways to improve this!&nbsp; <br />Please leave comments on either, I would love to read them.</p>
<p><strong><em>Disclaimer:<br /></em></strong><strong><em>This example is provided &ldquo;AS IS&rdquo; with no warranty expressed or implied. Run at your own risk. <br />The opinions and views expressed in this blog are those of the author and do not necessarily state or reflect those of Microsoft.</em></strong></p>
<p><strong><em><span style="color:#ff0000;">**Always test in your lab first**&nbsp; Do this at your own risk!! The author will not be held responsible for any damage you incur when making these changes!</span></em></strong></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/9828/00/00/03/62/78/09/MaintenanceModeTemplate.csv" original-url="http://blogs.technet.com/cfs-filesystemfile.ashx/__key/telligent-evolution-components-attachments/01-9828-00-00-03-62-78-09/MaintenanceModeTemplate.csv">MaintenanceModeTemplate.csv</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>