<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Everything System Center Operations Manager 2007</title><link>http://www.scom2k7.com</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Scom2k7blogspotcom" /><description></description><language>en</language><lastBuildDate>Wed, 28 Apr 2010 13:27:08 PDT</lastBuildDate><generator>http://wordpress.org/?v=3.0.1</generator><sy:updatePeriod xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">hourly</sy:updatePeriod><sy:updateFrequency xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">1</sy:updateFrequency><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Scom2k7blogspotcom" /><feedburner:info uri="scom2k7blogspotcom" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>SCOM Remote Maintenance Mode Scheduler 2.0 R2 Scripts</title><link>http://feedproxy.google.com/~r/Scom2k7blogspotcom/~3/G-9klKnY21g/</link><category>SCOM</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim</dc:creator><pubDate>Wed, 28 Apr 2010 11:38:29 PDT</pubDate><guid isPermaLink="false">http://www.scom2k7.com/?p=962</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>I have updated the scripts for <a href="http://www.scom2k7.com/scom-remote-maintenance-mode-scheduler-20/">SCOM Remote Maintenance Mode Scheduler 2.0</a> to properly support SCOM R2.<br />
</br><br />
Download: <a title="http://www.scom2k7.com/downloads/MaintenanceModeV4_R2.zip" href="http://www.scom2k7.com/downloads/MaintenanceModeV4_R2.zip">MaintenanceModeV4_R2.zip</a><br />
</br><br />
The old scripts worked ok but if you had a large group of servers it would take a long time with R2. The old scripts would try to put the HealthService and the HealthServiceWatcher in maintenance mode which is no longer necessary with R2.</p>
<p>Another thing I added to the scripts was to not re-set the maintenance mode of a server if it is already in maintenance mode.  I have seen instances where a particular server is put into maintenance mode for a long period of time and then a scheduled maintenance mode job will re-set the maintenance mode causing noise and skewed reports.</p>
<p><strong>To install</strong> the scripts just rename the old scripts and<span style="color: #ff0000;"> then copy the new scripts into the same “C:\MaintenanceModeV4” directory</span>.</p>
<p>**You will also might need to <a href="http://www.hanselman.com/blog/RemovingSecurityFromDownloadedPowerShellScriptsWithAlternativeDataStreams.aspx" target="_blank">Remove the Security from the Downloaded PowerShell Scripts </a></p>
<p><a href="http://www.scom2k7.com/wp-content/uploads/2010/04/foo.png"><img style="display: inline; border: 0px;" title="foo" src="http://www.scom2k7.com/wp-content/uploads/2010/04/foo_thumb.png" border="0" alt="foo" width="355" height="484" /></a></p>
<p>Please let me know if you come across any issues.</p>
<img src="http://feeds.feedburner.com/~r/Scom2k7blogspotcom/~4/G-9klKnY21g" height="1" width="1"/>]]></content:encoded><description>I have updated the scripts for SCOM Remote Maintenance Mode Scheduler 2.0 to properly support SCOM R2. Download: MaintenanceModeV4_R2.zip The old scripts worked ok but if you had a large group of servers it would take a long time with R2. The old scripts would try to put the HealthService and the HealthServiceWatcher in maintenance [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.scom2k7.com/scom-remote-maintenance-mode-scheduler-2-0-r2-scripts/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">10</slash:comments><feedburner:origLink>http://www.scom2k7.com/scom-remote-maintenance-mode-scheduler-2-0-r2-scripts/</feedburner:origLink></item><item><title>How to create a custom SCOM dashboard to show key Management Group information</title><link>http://feedproxy.google.com/~r/Scom2k7blogspotcom/~3/CNRY9ZAfV0M/</link><category>SCOM</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim</dc:creator><pubDate>Thu, 11 Mar 2010 22:46:07 PST</pubDate><guid isPermaLink="false">http://www.scom2k7.com/?p=932</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>You might have noticed that the SCCM Reporting Dashboard was released.  But what most of you don’t know is that you can use the dashboard for <span style="text-decoration: underline;"><strong>SCOM</strong></span> data.  The cool thing with the SCCM dashboard is that it&#8217;s and <strong>OPEN </strong>platform.  You can feed it a SQL query and it will display a live gauge or a graph.  This can be used query data from  the SCOM Operations DB, the Data Warehouse DB or any DB you want.</p>
<p><a href="http://www.scom2k7.com/wp-content/uploads/2010/03/image2.png"><img style="display: inline; border: 0px;" title="image" src="http://www.scom2k7.com/wp-content/uploads/2010/03/image_thumb2.png" border="0" alt="image" width="766" height="772" /></a></p>
<p>So how do we do it?</p>
<p>First we need to <strong>download and install the SCCM dashboard</strong>. You can download it at <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&#038;FamilyID=27fe0d80-38c6-464a-953a-1c2edcf35c2d">http://www.microsoft.com/downloads/details.aspx?displaylang=en&#038;FamilyID=27fe0d80-38c6-464a-953a-1c2edcf35c2d</a></p>
<p>Install the dashboard using the guide that comes with the download.</p>
<p><span style="color: #ff0000;">** If you don’t have SCCM that&#8217;s ok.  The install is just asking for a database.  So just type in the name of the Operations Manager Database.  Make sure the username and password has permissions or the install will fail.</span></p>
<p><a href="http://www.scom2k7.com/wp-content/uploads/2010/03/Capture.jpg"><img class="alignnone size-full wp-image-941" title="Capture" src="http://www.scom2k7.com/wp-content/uploads/2010/03/Capture.jpg" alt="" width="507" height="392" /></a></p>
<p>Input the information from the SharePoint installation.</p>
<p><a href="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image004.png"><img style="display: inline; border: 0px;" title="clip_image004" src="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image004_thumb.png" border="0" alt="clip_image004" width="516" height="401" /></a></p>
<p>After it&#8217;s installed your dashboard will look blank like this.  That OK it&#8217;s just because it doesn’t have any data to pull from.  So lets give it some data.</p>
<p><a href="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image006.jpg"><img style="display: inline; border: 0px;" title="clip_image006" src="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image006_thumb.jpg" border="0" alt="clip_image006" width="629" height="229" /></a></p>
<p>Go to <strong>Site Actions</strong> Edit Page</p>
<p><a href="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image007.png"><img style="display: inline; border: 0px;" title="clip_image007" src="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image007_thumb.png" border="0" alt="clip_image007" width="299" height="186" /></a></p>
<p>You should now see this configuration editor</p>
<p><a href="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image009.jpg"><img style="display: inline; border: 0px;" title="clip_image009" src="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image009_thumb.jpg" border="0" alt="clip_image009" width="628" height="402" /></a></p>
<p>Enter in a <strong>Name</strong> for the data and then enter in <strong>SQL Server</strong> and <strong>Database Name</strong></p>
<p>Then <strong>input</strong> a <strong>SQL query</strong> that you want to graph.</p>
<p><a href="http://www.scom2k7.com/wp-content/uploads/2010/03/image1.png"><img style="display: inline; border: 0px;" title="image" src="http://www.scom2k7.com/wp-content/uploads/2010/03/image_thumb1.png" border="0" alt="image" width="975" height="347" /></a></p>
<p>Here is the query I used to return back <strong># of Agents Responding and # of Agents not responding</strong>.</p>
<p><span style="color: #333399;">SELECT &#8216;Responding&#8217; as Status,  COUNT(*) as TotalMachines FROM ManagedEntityGenericView INNER JOIN ManagedTypeView<br />
ON ManagedEntityGenericView.MonitoringClassId = ManagedTypeView.Id<br />
WHERE (ManagedEntityGenericView.IsAvailable = &#8216;True&#8217;) AND (ManagedTypeView.Name = &#8216;Microsoft.SystemCenter.Agent&#8217;)<br />
Union<br />
SELECT &#8216;NotResponding&#8217; as Status,  COUNT(*) as TotalMachines FROM ManagedEntityGenericView INNER JOIN ManagedTypeView<br />
ON ManagedEntityGenericView.MonitoringClassId = ManagedTypeView.Id<br />
WHERE (ManagedEntityGenericView.IsAvailable = &#8216;false&#8217;) AND (ManagedTypeView.Name = &#8216;Microsoft.SystemCenter.Agent&#8217;)</span></p>
<p>Now choose the type of graph you want.  I choose PieChart</p>
<p><a href="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image012.png"><img style="display: inline; border: 0px;" title="clip_image012" src="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image012_thumb.png" border="0" alt="clip_image012" width="215" height="127" /></a></p>
<p>Give it a <strong>Title</strong></p>
<p><a href="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image014.jpg"><img style="display: inline; border: 0px;" title="clip_image014" src="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image014_thumb.jpg" border="0" alt="clip_image014" width="628" height="94" /></a></p>
<p>Then Choose <strong>Save and Close</strong></p>
<p>Now go to one of the Web Parts and Select edit <strong>Modify Shared Web Part</strong></p>
<p><a href="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image015.png"><img style="display: inline; border: 0px;" title="clip_image015" src="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image015_thumb.png" border="0" alt="clip_image015" width="211" height="126" /></a></p>
<p>In the top corner under &#8220;Select data set configuration&#8221;,  <strong>select the data set we just created</strong>. Then <strong>click OK</strong></p>
<p><a href="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image016.png"><img style="display: inline; border: 0px;" title="clip_image016" src="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image016_thumb.png" border="0" alt="clip_image016" width="248" height="177" /></a></p>
<p>The Agent Status should now show up in the web part.</p>
<p><a href="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image017.png"><img style="display: inline; border: 0px;" title="clip_image017" src="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image017_thumb.png" border="0" alt="clip_image017" width="486" height="555" /></a></p>
<p>Click <strong>Exit Edit Mode</strong> in the top right corner</p>
<p><a href="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image018.png"><img style="display: inline; border: 0px;" title="clip_image018" src="http://www.scom2k7.com/wp-content/uploads/2010/03/clip_image018_thumb.png" border="0" alt="clip_image018" width="117" height="37" /></a></p>
<p>Repeat the process with any other data set you want to display in a graph or gauge.</p>
<img src="http://feeds.feedburner.com/~r/Scom2k7blogspotcom/~4/CNRY9ZAfV0M" height="1" width="1"/>]]></content:encoded><description>You might have noticed that the SCCM Reporting Dashboard was released.  But what most of you don’t know is that you can use the dashboard for SCOM data.  The cool thing with the SCCM dashboard is that it&amp;#8217;s and OPEN platform.  You can feed it a SQL query and it will display a live gauge or [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.scom2k7.com/how-to-create-a-custom-scom-dashboard-to-show-key-management-group-information/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">7</slash:comments><feedburner:origLink>http://www.scom2k7.com/how-to-create-a-custom-scom-dashboard-to-show-key-management-group-information/</feedburner:origLink></item><item><title>Error when installing OpsMgr Reporting: ‘Could not verify if current user is in sysadmin Role’</title><link>http://feedproxy.google.com/~r/Scom2k7blogspotcom/~3/w9gLYnKUQqw/</link><category>SCOM</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim</dc:creator><pubDate>Sun, 17 Jan 2010 20:24:05 PST</pubDate><guid isPermaLink="false">http://www.scom2k7.com/?p=874</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Are you getting this error when trying to install reporting?&#160; </p>
<p mce_keep="true">&#160;<a href="http://www.scom2k7.com/wp-content/uploads/2010/01/error.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="error" border="0" alt="error" src="http://www.scom2k7.com/wp-content/uploads/2010/01/error_thumb.png" width="502" height="382" /></a> </p>
<p>Here are the steps to resolve it.</p>
<p>1.&#160; <strong>Check to User Permissions. </strong></p>
<blockquote><p><strong><font style="background-color: #ffffff">-&#160; </font></strong>Verify the user you are running the installer as is a member of the Operations Manager Administrators.       <br />-&#160; Verify the user has sysadmin access to the database in SQL. </p>
</blockquote>
<p>2.&#160; <strong>Check the SPN of the SDK Service. </strong></p>
<blockquote><p>- <a href="http://wchomak.spaces.live.com/blog/cns!F56EFE25599555EC!824.entry?sa=646856610">http://wchomak.spaces.live.com/blog/cns!F56EFE25599555EC!824.entry?sa=646856610</a>       <br />- <a href="http://blogs.technet.com/jonathanalmquist/archive/2008/08/14/operations-manager-2007-spn-s.aspx">http://blogs.technet.com/jonathanalmquist/archive/2008/08/14/operations-manager-2007-spn-s.aspx</a>       <br />- <a href="http://blogs.technet.com/kevinholman/archive/2007/12/13/system-center-operations-manager-sdk-service-failed-to-register-an-spn.aspx">http://blogs.technet.com/kevinholman/archive/2007/12/13/system-center-operations-manager-sdk-service-failed-to-register-an-spn.aspx</a></p>
</blockquote>
<p>3.&#160; <strong>Check the Operations Manager database.</strong> </p>
<blockquote><p>- Go into SQL Enterprise Management Studio&#160; <br />- Expand Databases, OperationsManager, and Tables       <br />- Right click on MT_ManagementGroup       <br />- Click Open Table if you are using SQL Server 2005 or click Edit Top 200 Rows if you are using SQL Server 2008.       <br />- Look at the Value in column SQLServerName_6B1D1BE8_EBB4_B425_08DC_2385C5930B04       <br />- This should be the name of your operations manager database server.&#160; (If you ever moved your operations manager database to a new SQL server there is a chance that this step got missed.)</p>
</blockquote>
<img src="http://feeds.feedburner.com/~r/Scom2k7blogspotcom/~4/w9gLYnKUQqw" height="1" width="1"/>]]></content:encoded><description>Are you getting this error when trying to install reporting?&amp;#160; &amp;#160; Here are the steps to resolve it. 1.&amp;#160; Check to User Permissions. -&amp;#160; Verify the user you are running the installer as is a member of the Operations Manager Administrators. -&amp;#160; Verify the user has sysadmin access to the database in SQL. 2.&amp;#160; Check [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.scom2k7.com/error-when-installing-opsmgr-reporting-could-not-verify-if-current-user-is-in-sysadmin-role/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><feedburner:origLink>http://www.scom2k7.com/error-when-installing-opsmgr-reporting-could-not-verify-if-current-user-is-in-sysadmin-role/</feedburner:origLink></item><item><title>MOMCertImport and UAC</title><link>http://feedproxy.google.com/~r/Scom2k7blogspotcom/~3/MlLZX0FXavI/</link><category>SCOM</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim</dc:creator><pubDate>Mon, 05 Oct 2009 11:13:01 PDT</pubDate><guid isPermaLink="false">http://www.scom2k7.com/?p=817</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>With the arrival of <strong>Windows Server 2008 R2</strong> it seems that more administrators are keeping UAC<strong> enabled</strong>.  I ran into an issue where I installed the certs for a gateway server and ran the cert import tool but kept getting this error</p>
<p> </p>
<p><strong>Event: 21016</strong></p>
<p>OpsMgr was unable to set up a communications channel to scomrms1.scom.com and there are no failover hosts.  Communication will resume when scomrms1.scom.com is available and communication from this computer is allowed.</p>
<p> </p>
<p>and</p>
<p> </p>
<p><strong>Event: 21007</strong></p>
<p> The OpsMgr Connector cannot create a mutually authenticated connection to scomrms.scom.com because it is not in a trusted domain.</p>
<p> </p>
<p>I ran MOMCertImport and everything seemed to be fine.  After taking a look into HKLM\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Machine Settings\ I realized that there was no reg key for ChannelCertificateSerialNumber.</p>
<p>This told me there was a problem with running the MOMCertImport tool as nothing was being written to the registry.</p>
<p>It turns out that running MOMCertImport doesn&#8217;t call the UAC dialog box the application runs and lets you select you cert and exits normally.  So what you must do is <strong>right click</strong> on <strong>MOMCertImport.exe</strong> and click on <strong>Run as administrator</strong>.</p>
<p><img class="alignnone size-full wp-image-818" title="CertImport" src="http://www.scom2k7.com/wp-content/uploads/2009/10/CertImport.png" alt="CertImport" width="280" height="371" /></p>
<p>Then click <strong>Continue</strong> in the UAC dialog box.</p>
<p><img class="alignnone size-full wp-image-819" title="Capture" src="http://www.scom2k7.com/wp-content/uploads/2009/10/Capture.PNG" alt="Capture" width="442" height="232" /></p>
<img src="http://feeds.feedburner.com/~r/Scom2k7blogspotcom/~4/MlLZX0FXavI" height="1" width="1"/>]]></content:encoded><description>With the arrival of Windows Server 2008 R2 it seems that more administrators are keeping UAC enabled.  I ran into an issue where I installed the certs for a gateway server and ran the cert import tool but kept getting this error   Event: 21016 OpsMgr was unable to set up a communications channel to scomrms1.scom.com and [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.scom2k7.com/momcertimport-and-uac/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://www.scom2k7.com/momcertimport-and-uac/</feedburner:origLink></item><item><title>Secure Reference Override Alerts</title><link>http://feedproxy.google.com/~r/Scom2k7blogspotcom/~3/M9MAooWugEI/</link><category>SCOM</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim</dc:creator><pubDate>Tue, 08 Sep 2009 20:20:46 PDT</pubDate><guid isPermaLink="false">http://www.scom2k7.com/?p=787</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>After installing the scom agent on a Red Hat 5.3  server and importing the management packs I started getting a bunch of  Secure Reference Override Alerts in my ops manager console.</p>
<p><span style="color: #ff0000;">The Health Service on computer SCOMMS.mydomain.com failed to resolve Secure Reference override. This issue may affect multiple instances. Additional details: Account for RunAs profile in workflow &#8220;Microsoft.Linux.RHEL.5.Process.Klog.Restart&#8221;, running for instance &#8220;Red Hat Enterprise Linux Server release 5.3 (Tikanga)&#8221; with id:&#8221;{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}&#8221; is not defined. Workflow will not be loaded. Please associate an account with the profile. Management group &#8220;MG&#8221;</span></p>
<p>So how do we fix these problems?  After searching for a solution I came across Marius Sutara&#8217;s Secure Reference Helper tool.   <a href="http://blogs.msdn.com/mariussutara/archive/2009/04/09/tool-opsmgr-2007-r2-what-to-do-with-secure-reference-override-alert.aspx">http://blogs.msdn.com/mariussutara/archive/2009/04/09/tool-opsmgr-2007-r2-what-to-do-with-secure-reference-override-alert.aspx</a></p>
<p>I downloaded the 64-bit version of the program but when I tried to install it, the installation failed.</p>
<p><img class="alignnone size-full wp-image-790" title="secure" src="http://www.scom2k7.com/wp-content/uploads/2009/09/secure1.png" alt="secure" width="671" height="60" /></p>
<p><img class="alignnone size-full wp-image-791" title="secure2" src="http://www.scom2k7.com/wp-content/uploads/2009/09/secure2.PNG" alt="secure2" width="449" height="165" /></p>
<p>I tried it on another RMS server and it failed there too.  So we can&#8217;t even use the tool because the installer doesn&#8217;t work.  <span style="text-decoration: underline;">Not so fast</span>.</p>
<p>Lets extract the files from the MSI and see what it does.</p>
<p><strong>msiexec /a &#8220;c:\temp\SecureReferenceSetup.x64.msi&#8221; /qb TARGETDIR=&#8221;c:\securefiles&#8221;</strong></p>
<p><img class="alignnone size-full wp-image-792" title="dos" src="http://www.scom2k7.com/wp-content/uploads/2009/09/dos.PNG" alt="dos" width="679" height="154" /></p>
<p>Here are the files from the MSI.</p>
<p><strong> </strong></p>
<p><strong>Microsoft.SystemCenter.Community.SecureReferenceHelper.xml</strong> -<span style="color: #ff0000;"> This file just creates the task in the actions pane.  (Not all that useful to me)<br />
</span><strong>SecureReference.exe</strong> &#8211; <span style="color: #ff0000;">This is the meat of the application.  You can run this program standalone as long as you have the .net 3.5 framework installed.<br />
</span><strong>SecureReference.SetupAction.exe</strong> - <span style="color: #ff0000;"> This is the installer that was failing.<br />
</span>So lets see what this puppy does.</p>
<p>I launch the <strong>SecureReference.exe</strong> app and get a login screen.  If you have admin access to the RMS you can just type in the RMS server name in the box.</p>
<p><img class="alignnone size-full wp-image-793" title="login" src="http://www.scom2k7.com/wp-content/uploads/2009/09/login.PNG" alt="login" width="402" height="303" /></p>
<p>I uncheck perform removal of duplicate alerts automatically.<br />
<img class="alignnone size-full wp-image-795" title="perform" src="http://www.scom2k7.com/wp-content/uploads/2009/09/perform.PNG" alt="perform" width="287" height="25" /></p>
<p>Using the tool and I can plainly see that the problem is with the Unix Privileged Account.  I set the Unix Privileged Account to my Unix Action Account and my problem is solved.</p>
<p><img class="alignnone size-full wp-image-798" title="tmac" src="http://www.scom2k7.com/wp-content/uploads/2009/09/tmac.gif" alt="tmac" width="800" height="600" /></p>
<p>**Update** some people were still having problems extracting the files so I posted the executable for the application on my blog.</p>
<p><a href="http://www.scom2k7.com/downloads/SecureReference.zip">http://www.scom2k7.com/downloads/SecureReference.zip</a></p>
<img src="http://feeds.feedburner.com/~r/Scom2k7blogspotcom/~4/M9MAooWugEI" height="1" width="1"/>]]></content:encoded><description>After installing the scom agent on a Red Hat 5.3  server and importing the management packs I started getting a bunch of  Secure Reference Override Alerts in my ops manager console. The Health Service on computer SCOMMS.mydomain.com failed to resolve Secure Reference override. This issue may affect multiple instances. Additional details: Account for RunAs profile [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.scom2k7.com/secure-reference-override-alerts/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">8</slash:comments><feedburner:origLink>http://www.scom2k7.com/secure-reference-override-alerts/</feedburner:origLink></item><item><title>Deleting a Distributed Application</title><link>http://feedproxy.google.com/~r/Scom2k7blogspotcom/~3/DDl3ac0xxr8/</link><category>SCOM</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim</dc:creator><pubDate>Thu, 13 Aug 2009 07:04:48 PDT</pubDate><guid isPermaLink="false">http://www.scom2k7.com/?p=777</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>If you try to delete a distributed application you may get an error like this.</p>
<p>Application: System Center Operations Manager 2007 R2<br />
Application Version: 6.1.7221.0<br />
Severity: Error<br />
Message:</p>
<p>: Verification failed with [1] errors:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
Error 1:<br />
: Failed to verify View with ID: View_1f1998325fe94ccb97855d7154bfa30c<br />
Target property :ManagementPackElement=Service_ceecc43c88ee428197f7eafbf91236e2 in ManagementPack:[Name=my.managementpack, KeyToken=, Version=1.0.0.0] for this View is incorrect.Cannot find ManagementPackElement [Type=ManagementPackClass, ID=Service_ceecc43c88ee428197f7eafbf91236e2] in ManagementPack [ManagementPack:[Name=my.managmentpack, KeyToken=, Version=1.0.0.0]]<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p><img class="alignnone size-full wp-image-778" title="error" src="http://www.scom2k7.com/wp-content/uploads/2009/08/error.png" alt="error" width="569" height="254" /></p>
<p> </p>
<p>The reason for this error is that there is a view that you created in the Monitoring Console to display the distributed application.  You have to delete this view first.  Then you can delete the distributed Application.</p>
<img src="http://feeds.feedburner.com/~r/Scom2k7blogspotcom/~4/DDl3ac0xxr8" height="1" width="1"/>]]></content:encoded><description>If you try to delete a distributed application you may get an error like this. Application: System Center Operations Manager 2007 R2 Application Version: 6.1.7221.0 Severity: Error Message: : Verification failed with [1] errors: &amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;&amp;#8212;- Error 1: : Failed to verify View with ID: View_1f1998325fe94ccb97855d7154bfa30c Target property :ManagementPackElement=Service_ceecc43c88ee428197f7eafbf91236e2 in ManagementPack:[Name=my.managementpack, KeyToken=, Version=1.0.0.0] for this View is [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.scom2k7.com/deleting-a-distributed-application/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><feedburner:origLink>http://www.scom2k7.com/deleting-a-distributed-application/</feedburner:origLink></item><item><title>Disabling SQL Express Instance Discoveries</title><link>http://feedproxy.google.com/~r/Scom2k7blogspotcom/~3/swOWrpnuesY/</link><category>SCOM</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim</dc:creator><pubDate>Tue, 07 Jul 2009 07:02:31 PDT</pubDate><guid isPermaLink="false">http://www.scom2k7.com/?p=759</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Our SQL Team doesn&#8217;t want to manage SQL Express installations. Typically SQL Express is used for Dev/Test and they don’t want to be alerted on these databases.</p>
<p>Turns out there is a nice override to disable discovery of these in the <strong>&#8220;SQL 200x Database Engines (Windows Server)&#8221; </strong>discovery.</p>
<p>All you need to do is find the SQL 200x Database Engines (Windows Server) discovery.  Create an override <strong>“For all objects of type: Windows Server” </strong></p>
<p><strong><img class="alignnone size-full wp-image-760" title="SCOM" src="http://www.scom2k7.com/wp-content/uploads/2009/07/SCOM.jpg" alt="SCOM" width="682" height="177" /></strong></p>
<p>Then choose the Parameter Name <strong>“Exclude List”</strong> and type in <strong>“SQLEXPRESS”. </strong></p>
<p><a href="http://www.scom2k7.com/wp-content/uploads/2009/07/exclude1.jpg"><img class="alignnone size-full wp-image-955" title="exclude" src="http://www.scom2k7.com/wp-content/uploads/2009/07/exclude1.jpg" alt="" width="766" height="146" /></a></p>
<img src="http://feeds.feedburner.com/~r/Scom2k7blogspotcom/~4/swOWrpnuesY" height="1" width="1"/>]]></content:encoded><description>Our SQL Team doesn&amp;#8217;t want to manage SQL Express installations. Typically SQL Express is used for Dev/Test and they don’t want to be alerted on these databases. Turns out there is a nice override to disable discovery of these in the &amp;#8220;SQL 200x Database Engines (Windows Server)&amp;#8221; discovery. All you need to do is find [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.scom2k7.com/disabling-sql-express-instance-discoveries/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">3</slash:comments><feedburner:origLink>http://www.scom2k7.com/disabling-sql-express-instance-discoveries/</feedburner:origLink></item><item><title>Writing C# applications to do complex monitoring with SCOM</title><link>http://feedproxy.google.com/~r/Scom2k7blogspotcom/~3/oX-U1Bf6-HU/</link><category>SCOM</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim</dc:creator><pubDate>Wed, 17 Jun 2009 18:28:46 PDT</pubDate><guid isPermaLink="false">http://www.scom2k7.com/?p=704</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p><font face="Arial">I ran into an issue where I needed to count the number of xml files in a directory.&nbsp; The problem was there are 10,000 other files in the directory.&nbsp; The application team didn&#8217;t care about the extra files and didn&#8217;t want to clean them out.&nbsp; All they wanted to know was when the number of XML files was over 15.<br /></font></p>
<p><font face="Arial">First I tried a basic vb script, like this.</font></p>
<p><font face="Arial"></font>&nbsp;</p>
<p><font color="#0000ff"><font color="#0000ff"></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">Set</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000"> objFSO=CreateObject(</font><span style="COLOR: #a31515">&#8220;Scripting.FileSystemObject&#8221;</span><font color="#000000">)<?xml:namespace prefix ="" o /><o:p></o:p></font></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000">S</font><span style="COLOR: blue">et</span><font color="#000000"> oArgs = WScript.Arguments<o:p></o:p></font></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p><font color="#000000">&nbsp;</font></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000">FolderName = oArgs(0)<o:p></o:p></font></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">Set</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000"> objFolder=objFSO.GetFolder(FolderName)<o:p></o:p></font></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p><font color="#000000">&nbsp;</font></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">Set</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000"> Dirfiles = objFolder.Files<o:p></o:p></font></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">Int</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000">&nbsp;filecount = 0<o:p></o:p></font></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; TEXT-INDENT: 0.5in; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">For</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000"> </font><span style="COLOR: blue">each</span><font color="#000000"> file </font><span style="COLOR: blue">In</span><font color="#000000"> Dirfiles<o:p></o:p></font></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p><font color="#000000">&nbsp;</font></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000"><span style="mso-spacerun: yes">&nbsp;&nbsp; </span><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>sext = objFSO.GetExtensionName(file.Path) <o:p></o:p></font></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></font></span></p>
<p style="LINE-HEIGHT: normal; TEXT-INDENT: 0.5in; MARGIN: 0in 0in 0pt 0.5in; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">If</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000"> LCase(sext) = </font><span style="COLOR: #a31515">&#8220;xml&#8221;</span><font color="#000000"> </font><span style="COLOR: blue">Then</span><font color="#000000"> <o:p></o:p></font></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000"><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></font></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>filecount = filecount+1<span style="mso-tab-count: 1"> </span><o:p></o:p></font></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></font></span></p>
<p style="LINE-HEIGHT: normal; TEXT-INDENT: 0.5in; MARGIN: 0in 0in 0pt 0.5in; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">End</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000"> </font><span style="COLOR: blue">If</span><font color="#000000"> <span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></font></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 1"><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font></span><span style="COLOR: blue">Next<o:p></o:p></span></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000"><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></font></span></p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000"><span style="mso-spacerun: yes">&nbsp;</span>WScript.Echo filecount</font></span></p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><font color="#000000"><o:p></o:p></font></span>&nbsp;</p>
<p></font></font></p>
<p><font color="#0000ff"><font color="#0000ff"><font color="#0000ff"></p>
<p></font></font></font></p>
</p>
<p><font face="Arial">This works fine in a directory with only a few files but my directory has 10,000 other files in it.&nbsp; I ran this script waited 10 minutes and then canceled it.&nbsp; Obviously this was not going to work as the script has to touch every file in the directory.&nbsp; Operations Manager would time out way before&nbsp;the script&nbsp;finishes.</font><font color="#0066cc"></p>
<p></font></p>
<p><font face="Arial">So after many Google and Bing searches looking for a different vb scripts to count only the xml files, I decided to see how easy it would be in C#.</font></p>
<p><font face="Arial">In C# it was a piece of cake.&nbsp; You can download the C# project file with source here. <br /></font><font face="Arial"><a href="http://www.scom2k7.com/downloads/filecount.zip">http://www.scom2k7.com/downloads/filecount.zip</a></font><font face="Arial">&nbsp;</font></p>
<p><font face="Arial"></font><font face="Arial">&nbsp;</p>
<p></font><font face="Arial"></font></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">using</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> System;<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">using</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> System.Collections.Generic;<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">using</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> System.Linq;<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">using</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> System.Text;<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">using</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> System.IO;<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">namespace</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> filecount<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">{<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span><span style="COLOR: blue">class</span> <span style="COLOR: #2b91af">Program<o:p></o:p></span></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>{<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: blue">static</span> <span style="COLOR: blue">void</span> Main(<span style="COLOR: blue">string</span>[] args)<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>{<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: blue">string</span> directoryPath = args[0];<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: blue">string</span> eXtension = <span style="COLOR: #a31515">&#8220;*.&#8221;</span> + args[1];<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: blue">int</span> fileCount = System.IO.<span style="COLOR: #2b91af">Directory</span>.GetFiles(directoryPath, </span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">eXtension).Length; <o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: #2b91af">Console</span>.WriteLine(fileCount);<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>}<o:p></o:p></span></p>
<p><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA">}</span></p>
<p><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"></span>&nbsp;</p>
<p><font face="Arial">I ran the executable that&nbsp;visual studio created with two parameters &#8220;directory&#8221; and &#8220;extension&#8221; and it took&nbsp;one second to count the number of xml files in the directory.&nbsp; This is what I was looking for,&nbsp;way faster and more efficient.</font>&nbsp; </p>
<p><img border="0" alt="Commandline" src="http://www.scom2k7.com/wp-content/uploads/2009/06/commandline2.jpg" /></p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><font face="Arial">So now I have a working executable the takes two parameters.<span style="mso-spacerun: yes">&nbsp; H</span>ow do I get it to work with SCOM?<span style="mso-spacerun: yes">&nbsp; </span></font></p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><font face="Arial">The easiest way was to remove the <span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-no-proof: yes">Console</span><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">.WriteLine(fileCount)</span></font><font size="3"><font face="Calibri"><font size="2" face="Arial"> and set the count to the exit code.</font><span style="mso-spacerun: yes">&nbsp; </span></font></font></p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-no-proof: yes"></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: #2b91af; FONT-SIZE: 10pt; mso-no-proof: yes">Environment</span><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">.Exit(fileCount);</span></p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><font face="Arial">Now all&nbsp;I need to do is wrap this executable with a vbscipt and have SCOM call it. You can download the vb script here. <a href="http://www.scom2k7.com/downloads/advanced.zip">http://www.scom2k7.com/downloads/advanced.zip</a></font><font face="Arial"></p>
<p></font></p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><font face="Arial"></font>&nbsp;</p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">Dim</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> oAPI, oBag, objShell, objFSO, objFile, myCMD, bWaitOnReturn, returnCmd, oArgs<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">Set</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> oAPI = CreateObject(<span style="COLOR: #a31515">&#8220;MOM.ScriptAPI&#8221;</span>)<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">Set</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> oBag = oAPI.CreateTypedPropertyBag(StateDataType)<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">Set</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> oArgs = WScript.Arguments<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">If</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> oArgs.Count &lt;&nbsp;3 <span style="COLOR: blue">Then</span> <o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">Call</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> oAPI.LogScriptEvent(<span style="COLOR: #a31515">&#8220;FileCountCSharp.vbs&#8221;</span>, 500, 0, <span style="COLOR: #a31515">&#8220;Script aborted. Not enough parameters provided.&#8221;</span>) <o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">WScript.Quit -1 <o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">End</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> <span style="COLOR: blue">If</span> <o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">folder = oArgs(0)<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">extension = oArgs(1)<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">userCount = <span style="COLOR: blue">cint</span>(oArgs(2))<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">bWaitOnReturn= <span style="COLOR: blue">True<o:p></o:p></span></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp; </span><o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&nbsp; </span><o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">Set</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> objShell=CreateObject(<span style="COLOR: #a31515">&#8220;WScript.Shell&#8221;</span>)<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">Set</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> objFSO=CreateObject(<span style="COLOR: #a31515">&#8220;Scripting.FileSystemObject&#8221;</span>)<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">strPath=<span style="COLOR: #a31515">&#8220;C:\ScomTools\filecount.exe&#8221;<o:p></o:p></span></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: #a31515; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">If</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> objFSO.FileExists(strPath) <span style="COLOR: blue">Then<o:p></o:p></span></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">set</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> objFile=objFSO.GetFile(strPath)<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">myCMD = strPath &amp; <span style="COLOR: #a31515">&#8221; &#8220;</span> &amp; folder &amp; <span style="COLOR: #a31515">&#8221; &#8220;</span> &amp; extension <o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">returnCmd = objShell.Run (myCMD,0,bWaitOnReturn)<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">Else<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">Call</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> oAPI.LogScriptEvent(<span style="COLOR: #a31515">&#8220;filecount.exe&#8221;</span>, 510, 0, <span style="COLOR: #a31515">&#8220;Can&#8217;t find EXE to run Script&#8221;</span>) <o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">WScript.Quit<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">End</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> <span style="COLOR: blue">If<o:p></o:p></span></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">If</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> returnCmd &gt; userCount <span style="COLOR: blue">Then<o:p></o:p></span></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>strReturn = userCount<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: blue">Call</span> oBag.AddValue(<span style="COLOR: #a31515">&#8220;State&#8221;</span>,<span style="COLOR: #a31515">&#8220;BAD&#8221;</span>)<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: blue">Call</span> oBag.AddValue(<span style="COLOR: #a31515">&#8220;ret&#8221;</span>,strReturn)<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: blue">Else<o:p></o:p></span></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><span style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="COLOR: blue">Call</span> oBag.AddValue(<span style="COLOR: #a31515">&#8220;State&#8221;</span>,<span style="COLOR: #a31515">&#8220;GOOD&#8221;</span>)<o:p></o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">End</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> <span style="COLOR: blue">If<o:p></o:p></span></span></p>
<p style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p>&nbsp;</o:p></span></p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt; mso-no-proof: yes">Call</span><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"> oAPI.Return(oBag)</span></p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p></o:p></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><font size="3" face="Calibri"><font size="2" face="Arial">To test it I ran this command <b style="mso-bidi-font-weight: normal"><span style="COLOR: red">cscript c:\temp\newtest.vbs &#8220;c:\temp&#8221; &#8220;xml&#8221; 4 </span></b>saying if there are more than 4 files in the directory and should return BAD state and how many files actual files are in the directory.<span style="mso-spacerun: yes">&nbsp; </span>This is what I got back.</font> </font></p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><font size="3" face="Calibri"></font>&nbsp;</p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">&lt;DataItem type=&#8221;System.PropertyBagData&#8221; time=&#8221;2009-06-17T10:58:59.3066298-04:00&#8243;<br /></span><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes">sourceHealthServiceId=&#8221;B3B5A38D-0DBE-5CA9-592D-B76333A989D8&#8243;&gt;<br />&lt;Property Name=&#8221;State&#8221;VariantType=&#8221;8&#8243;&gt;<b style="mso-bidi-font-weight: normal"><span style="COLOR: red">BAD</span></b>&lt;/Property&gt;<br />&lt;Property Name=&#8221;ret&#8221; VariantType=&#8221;3&#8243;&gt;<b style="mso-bidi-font-weight: normal"><span style="COLOR: red">5</span></b>&lt;/Property&gt;&lt;/DataItem&gt;</span></p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt; mso-no-proof: yes"><o:p></o:p></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><font face="Arial">Looks good now to test a good condition.<span style="mso-spacerun: yes">&nbsp; </span><b style="mso-bidi-font-weight: normal"><span style="COLOR: red">cscript c:\temp\newtest.vbs &#8220;c:\temp&#8221; &#8220;xml&#8221; 25 </span></b>saying if there is more than 25 xml files create an alert.<span style="mso-spacerun: yes">&nbsp; </span>There is not <span style="mso-spacerun: yes">&nbsp;</span>more than 25 files so the scom script should return good.</font></p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><font face="Arial"></font>&nbsp;</p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">&lt;DataItem type=&#8221;System.PropertyBagData&#8221; time=&#8221;2009-06-17T10:59:34.5256052-04:00&#8243;<br /></span><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt">sourceHealthServiceId=&#8221;B3B5A38D-0DBE-5CA9-592D-B76333A989D8&#8243;&gt;<br />&lt;Property Name=&#8221;State&#8221; VariantType=&#8221;8&#8243;&gt;<font color="#ff0000"><strong>GOOD</strong></font>&lt;/Property&gt;&lt;/DataItem&gt;</span></p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><span style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 10pt"><o:p></o:p></span>&nbsp;</p>
<p><img border="0" alt="Command2" src="http://www.scom2k7.com/wp-content/uploads/2009/06/command22.jpg" /></p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><font face="Arial">Ok now we have a good working script and c# executable.<span style="mso-spacerun: yes">&nbsp; </span>Now we just need to put the script into a monitor and copy the file to the server we want to monitor and we are done.<span style="mso-spacerun: yes">&nbsp; </span>You can follow these directions if you don&rsquo;t know how to put the script into a monitor.<span style="mso-spacerun: yes">&nbsp; </span></font><a href="http://www.scom2k7.com/create-a-script-based-unit-monitor-in-opsmgr2007-via-the-gui/"><font color="#0000ff" face="Arial">http://www.scom2k7.com/create-a-script-based-unit-monitor-in-opsmgr2007-via-the-gui/</font></a></p>
<p style="MARGIN: 0in 0in 10pt" class="MsoNormal"><font face="Arial">So now think of the possibilities.<span style="mso-spacerun: yes">&nbsp; </span>Anything that can be called from C# can now be monitored in SCOM.<span style="mso-spacerun: yes">&nbsp; </span>SDKs, APIs, Web Services, are all easily leveraged in C#.<span style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </span>The only downside is you need&nbsp;the executable on the&nbsp;server the monitor is running on, but that could be fixed by having the script to check for the executable and if it wasn&rsquo;t there you could copy it from a centralized network location.</font></p>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/Scom2k7blogspotcom/~4/oX-U1Bf6-HU" height="1" width="1"/>]]></content:encoded><description>I ran into an issue where I needed to count the number of xml files in a directory.&amp;#160; The problem was there are 10,000 other files in the directory.&amp;#160; The application team didn&amp;#8217;t care about the extra files and didn&amp;#8217;t want to clean them out.&amp;#160; All they wanted to know was when the number of [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.scom2k7.com/writing-c-applications-to-do-complex-monitoring-with-scom/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">6</slash:comments><feedburner:origLink>http://www.scom2k7.com/writing-c-applications-to-do-complex-monitoring-with-scom/</feedburner:origLink></item><item><title>Windows Server 2008 R2 Service Pack Level at RTM</title><link>http://feedproxy.google.com/~r/Scom2k7blogspotcom/~3/t5AJQZr4bPc/</link><category>SCOM</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim</dc:creator><pubDate>Mon, 15 Jun 2009 21:29:20 PDT</pubDate><guid isPermaLink="false">http://www.scom2k7.com/?p=681</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>From <a href="http://www.expta.com/2009/06/windows-server-2008-r2-service-pack.html">http://www.expta.com/2009/06/windows-server-2008-r2-service-pack.html</a></p>
<div><span class="Apple-style-span" style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: 16px 'Times New Roman'; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"></span></div>
<p><span class="Apple-style-span" style="widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font: 16px 'Times New Roman'; white-space: normal; orphans: 2; letter-spacing: normal; color: #000000; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><span class="Apple-style-span" style="text-align: left; line-height: 18px; font-family: 'Trebuchet MS'; color: #333333; font-size: 13px;"></p>
<p style="margin: 0px 0px 0.75em;">You may have known that Windows Server 2008 RTM<span class="Apple-converted-space"> </span><a style="color: #666666;" href="http://www.expta.com/2008/01/windows-server-2008-sp1.html">shipped as Service Pack 1</a>. This is because the Windows Server 2008 code base is shared by Windows Vista, and Windows Vista was at SP1 when 2008 shipped. Windows Server 2008 SP2 was released on May 26, 2009 and was the first service pack you can actually apply to Windows Server 2008.</p>
<p style="margin: 0px 0px 0.75em;">Unlike Windows Server 2003 R2, which was based on the same code base as Windows Server 2003 SP1, Windows Server 2008 R2 is based on an entirely different code base (Windows 7). The Windows 7 code base is derived from Vista, but is actually a seperate kernel. This change in strategy was required to address challenges that 2008 R2 faced, such as hardware platforms with many processor cores and new power saving features that couldn&#8217;t be addressed by keeping the same kernel as Server 2008.</p>
<p style="margin: 0px 0px 0.75em;"><strong>For this reason, Windows Server 2008 R2 RTM will ship as service pack level SP0, not SP1.</strong></p>
<p style="margin: 0px 0px 0.75em;"><strong></strong></p>
<p style="margin: 0px 0px 0.75em;">Good to know as I plan on upgrading all of my SCOM R2 Servers to Windows 2008 R2.</p>
<p> </p>
<p></span></span></p>
<img src="http://feeds.feedburner.com/~r/Scom2k7blogspotcom/~4/t5AJQZr4bPc" height="1" width="1"/>]]></content:encoded><description>From http://www.expta.com/2009/06/windows-server-2008-r2-service-pack.html You may have known that Windows Server 2008 RTM shipped as Service Pack 1. This is because the Windows Server 2008 code base is shared by Windows Vista, and Windows Vista was at SP1 when 2008 shipped. Windows Server 2008 SP2 was released on May 26, 2009 and was the first service pack you [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.scom2k7.com/windows-server-2008-r2-service-pack-level-at-rtm/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">6</slash:comments><feedburner:origLink>http://www.scom2k7.com/windows-server-2008-r2-service-pack-level-at-rtm/</feedburner:origLink></item><item><title>Passed the 70-400 test today with a 980!</title><link>http://feedproxy.google.com/~r/Scom2k7blogspotcom/~3/Mvqqfo5qu7o/</link><category>SCOM</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim</dc:creator><pubDate>Mon, 11 May 2009 10:12:35 PDT</pubDate><guid isPermaLink="false">http://www.scom2k7.com/?p=673</guid><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Today I took the 70-400 Microsoft System Center Operations Manager 2007, Configuring and passed with a 980.  I was shooting for a 1000 and fell one question short. </p>
<p><img src="http://www.scom2k7.com/wp-content/uploads/2009/05/70-4001.jpg" alt="70-4001" title="70-4001" width="639" height="174" class="alignnone size-full wp-image-678" /></p>
<img src="http://feeds.feedburner.com/~r/Scom2k7blogspotcom/~4/Mvqqfo5qu7o" height="1" width="1"/>]]></content:encoded><description>Today I took the 70-400 Microsoft System Center Operations Manager 2007, Configuring and passed with a 980. I was shooting for a 1000 and fell one question short.</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.scom2k7.com/passed-the-70-400-test-today-with-a-980/feed/</wfw:commentRss><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><feedburner:origLink>http://www.scom2k7.com/passed-the-70-400-test-today-with-a-980/</feedburner:origLink></item></channel></rss>
