<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>System Center WebLog by Russ Slaten : SCCM 2007</title><link>http://blogs.msdn.com/rslaten/archive/tags/SCCM+2007/default.aspx</link><description>Tags: SCCM 2007</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>URL Monitoring Part III – The Monitors</title><link>http://blogs.msdn.com/rslaten/archive/2009/07/07/url-monitoring-part-iii-the-monitors.aspx</link><pubDate>Wed, 08 Jul 2009 00:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9823156</guid><dc:creator>rslaten</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/rslaten/comments/9823156.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rslaten/commentrss.aspx?PostID=9823156</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rslaten/rsscomments.aspx?PostID=9823156</wfw:comment><description>&lt;P&gt;This entry is part of the following series: &lt;BR&gt;&lt;A href="http://blogs.msdn.com/rslaten/archive/2009/07/07/custom-url-monitoring-part-i-the-design.aspx" mce_href="http://blogs.msdn.com/rslaten/archive/2009/07/07/custom-url-monitoring-part-i-the-design.aspx"&gt;URL Monitoring Part I – The Design&lt;/A&gt; &lt;BR&gt;&lt;A href="http://blogs.msdn.com/rslaten/archive/2009/07/07/url-monitoring-part-ii-the-classes-and-discoveries.aspx" mce_href="http://blogs.msdn.com/rslaten/archive/2009/07/07/url-monitoring-part-ii-the-classes-and-discoveries.aspx"&gt;URL Monitoring Part II – The Classes and Discoveries&lt;/A&gt; &lt;BR&gt;&lt;A href="http://blogs.msdn.com/rslaten/archive/2009/07/07/url-monitoring-part-iii-the-monitors.aspx" mce_href="http://blogs.msdn.com/rslaten/archive/2009/07/07/url-monitoring-part-iii-the-monitors.aspx"&gt;URL Monitoring Part III – The Monitors&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Creating the monitors was by far the most complex part of this solution because monitors do not use data sources directly.&amp;nbsp; Instead, they use Monitor Types which in turn use data sources.&amp;nbsp; This is because data sources don’t understand the difference between what is considered healthy and what isn’t.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Again, I will use the System Center Configuration Manager Management Point monitor for this example since the other scenarios are built in the same way.&lt;/P&gt;
&lt;P&gt;Step 1 – Creating the web page up/down data source.&amp;nbsp; This custom data source is generic and can be used for any URL but its primary function is to return whether or not a web page returns with or without error.&amp;nbsp; &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture15.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture15.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture15 border=0 alt=Capture15 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture15_thumb.jpg" width=604 height=641 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture15_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;I use the System.Scheduler and Microsoft.SystemCenter.WebApplication.UrlProbe modules so this MP does take a dependency on the Web Application Library MP.&amp;nbsp; Make sure this is added as a reference under File\Management Pack Properties before continuing. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture16.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture16.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture16 border=0 alt=Capture16 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture16_thumb.jpg" width=604 height=641 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture16_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The System.Scheduler module is used for kicking off the URL Probe on a dynamic interval which in my example ends up being every 15 seconds.&amp;nbsp; This is a parameter that is passed at the monitor level. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture17.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture17.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture17 border=0 alt=Capture17 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture17_thumb.jpg" width=604 height=607 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture17_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The Microsoft.SystemCenter.WebApplication.URLProbe module is very complex so I pasted the configuration below:&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#c0c0c0&gt;&amp;lt;ProbeAction ID="Probe" TypeID="MicrosoftSystemCenterWebApplicationLibrary!Microsoft.SystemCenter.WebApplication.UrlProbe"&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;Proxy /&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;ProxyUserName /&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;ProxyPassword /&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;ProxyAuthenticationScheme&amp;gt;None&amp;lt;/ProxyAuthenticationScheme&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;CredentialUserName /&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;CredentialPassword /&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;AuthenticationScheme&amp;gt;None&amp;lt;/AuthenticationScheme&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;FollowRedirects&amp;gt;true&amp;lt;/FollowRedirects&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;RetryCount&amp;gt;0&amp;lt;/RetryCount&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;RequestTimeout&amp;gt;0&amp;lt;/RequestTimeout&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;Requests&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Request&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;RequestID&amp;gt;1&amp;lt;/RequestID&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;URL&amp;gt;$Config/URLPath$&amp;lt;/URL&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Verb&amp;gt;GET&amp;lt;/Verb&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Version&amp;gt;HTTP/1.1&amp;lt;/Version&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;HttpHeaders&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;HttpHeader&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Name&amp;gt;User-Agent&amp;lt;/Name&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Value&amp;gt;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)&amp;lt;/Value&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/HttpHeader&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/HttpHeaders&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Body /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;CheckContentChange&amp;gt;false&amp;lt;/CheckContentChange&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ContentHash&amp;gt;00000000-0000-0000-0000-000000000000&amp;lt;/ContentHash&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Depth&amp;gt;0&amp;lt;/Depth&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ThinkTime&amp;gt;0&amp;lt;/ThinkTime&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;CheckInternalLinks&amp;gt;false&amp;lt;/CheckInternalLinks&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;CheckExternalLinks&amp;gt;false&amp;lt;/CheckExternalLinks&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;CheckResources&amp;gt;false&amp;lt;/CheckResources&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;RequestEvaluationCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;StopProcessingIfWarningCriteriaIsMet&amp;gt;false&amp;lt;/StopProcessingIfWarningCriteriaIsMet&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;StopProcessingIfErrorCriteriaIsMet&amp;gt;false&amp;lt;/StopProcessingIfErrorCriteriaIsMet&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;BasePageEvaluationCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;WarningCriteria /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ErrorCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;NumericCriteriaExpressions&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;NumericCriteriaExpression&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;NumericRequestMetric&amp;gt;BasePageData/TotalResponseTime&amp;lt;/NumericRequestMetric&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Operator&amp;gt;Greater&amp;lt;/Operator&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Value&amp;gt;$Config/ResponseTime$&amp;lt;/Value&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/NumericCriteriaExpression&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/NumericCriteriaExpressions&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ErrorCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/BasePageEvaluationCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;LinksEvaluationCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;WarningCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;StatusCodeCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ListNumericRequestMetric&amp;gt;StatusCode&amp;lt;/ListNumericRequestMetric&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Operator&amp;gt;GreaterEqual&amp;lt;/Operator&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Value&amp;gt;400&amp;lt;/Value&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/StatusCodeCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/WarningCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ErrorCriteria /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/LinksEvaluationCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ResourcesEvaluationCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;WarningCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;StatusCodeCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ListNumericRequestMetric&amp;gt;StatusCode&amp;lt;/ListNumericRequestMetric&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Operator&amp;gt;GreaterEqual&amp;lt;/Operator&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Value&amp;gt;400&amp;lt;/Value&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/StatusCodeCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/WarningCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ErrorCriteria /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ResourcesEvaluationCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;WebPageTotalEvaluationCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;WarningCriteria /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ErrorCriteria /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/WebPageTotalEvaluationCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;DepthEvaluationCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;WarningCriteria /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ErrorCriteria /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/DepthEvaluationCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/RequestEvaluationCriteria&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;FormsAuthCredentials /&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Request&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;/Requests&amp;gt; &lt;BR&gt;&amp;lt;/ProbeAction&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;This is passed to another data source in the Web Application Library which uses internal libraries to do the actual HTTP request.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The Configuration Schema tab contains the parameters which are passed to this data source.&amp;nbsp; Currently it only accepts the URL and the interval at which the URL is to be watched. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture18.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture18.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture18 border=0 alt=Capture18 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture18_thumb.jpg" width=604 height=638 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture18_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;This Data Source should output WebApplicationData. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture19.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture19.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture19 border=0 alt=Capture19 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture19_thumb.jpg" width=604 height=644 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture19_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Step 2 – Creating the Monitor Type.&amp;nbsp; The Monitor Type takes parameters from the Monitor and passes them onto the data source.&amp;nbsp; It also evaluates the data source to help the monitor determine what criteria equals healthy versus unhealthy. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture20.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture20.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture20 border=0 alt=Capture20 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture20_thumb.jpg" width=604 height=599 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture20_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;For States just enter something that makes sense for the type of monitor you will be using. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture21.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture21.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture21 border=0 alt=Capture21 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture21_thumb.jpg" width=604 height=602 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture21_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The Member Modules start with the data source we just created.&amp;nbsp; The Condition Detections are used to evaluate the results of the data source and the Probe Action is used to recalculate the state of the monitor manually. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture22.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture22.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture22 border=0 alt=Capture22 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture22_thumb.jpg" width=604 height=599 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture22_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The configuration of the data source module is fairly simple in that we are accepting parameters from the monitor (which we haven’t created yet) and are just re-passing them to the data source. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture23.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture23.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture23 border=0 alt=Capture23 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture23_thumb.jpg" width=604 height=607 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture23_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The first expression filter evaluates the web page as down. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture24.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture24.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture24 border=0 alt=Capture24 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture24_thumb.jpg" width=604 height=526 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture24_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The second expression filter evaluates the web page as up. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture25.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture25.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture25 border=0 alt=Capture25 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture25_thumb.jpg" width=604 height=524 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture25_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The OnDemandReset Probe Action does not contain any custom configuration information.&lt;/P&gt;
&lt;P&gt;Next we have to specify what order the modules will be executed for the regular detection when there is a failure. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture26.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture26.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture26 border=0 alt=Capture26 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture26_thumb.jpg" width=604 height=599 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture26_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;Next we have to specify what order the modules will be executed for the regular detection when there is not a failure. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture27.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture27.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture27 border=0 alt=Capture27 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture27_thumb.jpg" width=604 height=604 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture27_thumb.jpg"&gt;&lt;/A&gt; &lt;BR&gt;
&lt;P&gt;For On Demand we just use the ErrorCodeOK state. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture28.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture28.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture28 border=0 alt=Capture28 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture28_thumb.jpg" width=604 height=599 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture28_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The Configuration Schema defines what parameters this Monitor Type accepts. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture29.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture29.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture29 border=0 alt=Capture29 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture29_thumb.jpg" width=604 height=602 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture29_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Step 3 – Create the Monitor.&amp;nbsp; The monitor is a custom monitor which uses the monitor type we just created.&amp;nbsp; It is also targeted to the SCCMMP class which we created in Part II of this series. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture30.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture30.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture30 border=0 alt=Capture30 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture30_thumb.jpg" width=604 height=604 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture30_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The Configuration is how often we want to query the URL and the URL itself.&amp;nbsp; In this case we want the URL to be the registry value(s) that we discovered in the SCCMMP class.&amp;nbsp; This is how one monitor can be used to watch thousands of websites.&amp;nbsp; &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture31.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture31.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture31 border=0 alt=Capture31 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture31_thumb.jpg" width=604 height=576 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture31_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;We must tell the monitor which state means Critical and which means Healthy. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture32.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture32.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture32 border=0 alt=Capture32 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture32_thumb.jpg" width=604 height=576 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture32_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;I set the example monitor to not alert but this can obviously be configured.&amp;nbsp; Also, in the final solution for my customer we sealed the data sources and monitor types and used a different MP for the classes, discoveries, relationships, and monitors.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;To test out this solution the MP you just created can be imported and if the agent from Part II still exists the discovered inventory should look like this: &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture33.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture33.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture33 border=0 alt=Capture33 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture33_thumb.jpg" width=604 height=404 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture33_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;I don’t have a website with this name so it shows as critical.&amp;nbsp; This is what Health Explorer looks like: &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture34.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture34.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture34 border=0 alt=Capture34 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture34_thumb.jpg" width=604 height=449 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIITheMonitors_CB4A/Capture34_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;If you want to do some more testing add some real URLs to the SCCMMP registry key and add that key to some more watcher nodes.&amp;nbsp; Also, open the MP attached to Part I and look at the other classes and data sources to understand how the text parsing and response time solutions work.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;If you have any questions about this series please let me know.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9823156" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rslaten/archive/tags/SCCM+2007/default.aspx">SCCM 2007</category><category domain="http://blogs.msdn.com/rslaten/archive/tags/SCOM+2007/default.aspx">SCOM 2007</category></item><item><title>URL Monitoring Part II – The Classes and Discoveries</title><link>http://blogs.msdn.com/rslaten/archive/2009/07/07/url-monitoring-part-ii-the-classes-and-discoveries.aspx</link><pubDate>Wed, 08 Jul 2009 00:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9823148</guid><dc:creator>rslaten</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/rslaten/comments/9823148.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rslaten/commentrss.aspx?PostID=9823148</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rslaten/rsscomments.aspx?PostID=9823148</wfw:comment><description>&lt;P&gt;This entry is part of the following series: &lt;BR&gt;&lt;A href="http://blogs.msdn.com/rslaten/archive/2009/07/07/custom-url-monitoring-part-i-the-design.aspx" mce_href="http://blogs.msdn.com/rslaten/archive/2009/07/07/custom-url-monitoring-part-i-the-design.aspx"&gt;URL Monitoring Part I – The Design&lt;/A&gt; &lt;BR&gt;&lt;A href="http://blogs.msdn.com/rslaten/archive/2009/07/07/url-monitoring-part-ii-the-classes-and-discoveries.aspx" mce_href="http://blogs.msdn.com/rslaten/archive/2009/07/07/url-monitoring-part-ii-the-classes-and-discoveries.aspx"&gt;URL Monitoring Part II – The Classes and Discoveries&lt;/A&gt; &lt;BR&gt;&lt;A href="http://blogs.msdn.com/rslaten/archive/2009/07/07/url-monitoring-part-iii-the-monitors.aspx" mce_href="http://blogs.msdn.com/rslaten/archive/2009/07/07/url-monitoring-part-iii-the-monitors.aspx"&gt;URL Monitoring Part III – The Monitors&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Each of the 3 web applications has its own class.&amp;nbsp; The applicable discovery queries a registry key and based on the values in that key creates an instance of the proper web application’s class.&amp;nbsp; Also, each web application can contain multiple URLs if necessary.&lt;/P&gt;
&lt;P&gt;I will use the class I created to monitor System Center Configuration Manager Management Points for this example because they are all built the same way.&lt;/P&gt;
&lt;P&gt;Step 1 - The first thing I did was create a new custom class in the authoring console.&amp;nbsp; The base class is System.Perspective.&amp;nbsp; Notice that one of the attributes is “Hosted”.&amp;nbsp; Do not worry about checking this yet because once we add a relationship it will be checked automatically.&amp;nbsp; Also, I always make what I create “Public”.&amp;nbsp; This is important if you decide to seal the MP and want to access the class from a separate management pack. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture1.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture1.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture1 border=0 alt=Capture1 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture1_thumb.jpg" width=604 height=614 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture1_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;I added an attribute called “URL” and made it a key value.&amp;nbsp; When the instance of this class is created the “URL” attribute will contain the URL we will be monitoring. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture2.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture2.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture2 border=0 alt=Capture2 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture2_thumb.jpg" width=604 height=612 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture2_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Step 2 – Next I created a relationship so that the URL we are monitoring is tied to the Watcher Node.&amp;nbsp; I made this a hosting relationship and made it public. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture3.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture3.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture3 border=0 alt=Capture3 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture3_thumb.jpg" width=604 height=614 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture3_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Step 3 – I then created a new custom data source that the discovery will end up using to create instances of the SCCM MP Class in addition to the other classes I use in the solution. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture4.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture4.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture4 border=0 alt=Capture4 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture4_thumb.jpg" width=604 height=602 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture4_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I use the System.Scheduler and Microsoft.Windows.ScriptDiscoveryProbe modules in this data source &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture5.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture5.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture5 border=0 alt=Capture5 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture5_thumb.jpg" width=604 height=604 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture5_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The System.Scheduler module takes a parameter which is passed to the data source by the discovery itself.&amp;nbsp; This parameter is the interval at which the discovery should be run in seconds. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture6.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture6.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture6 border=0 alt=Capture6 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture6_thumb.jpg" width=604 height=604 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture6_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The Microsoft.Windows.ScriptDiscoveryProbe module is used to run a script that returns discovery data. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture7.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture7.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture7 border=0 alt=Capture7 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture7_thumb.jpg" width=604 height=607 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture7_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The Microsoft.Windows.ScriptDiscoveryProbe module is a bit more complex so I will paste the configuration below: &lt;BR&gt;&lt;BR&gt;&lt;FONT color=#c0c0c0&gt;&amp;lt;ProbeAction ID="DiscoveryProbe" TypeID="Windows!Microsoft.Windows.ScriptDiscoveryProbe"&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;ScriptName&amp;gt;WatcherDiscovery.vbs&amp;lt;/ScriptName&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;Arguments&amp;gt;$Config/FQDN$ $Config/SourceID$ $Config/ManagedEntityID$ $Config/Class$ $Config/Property$ $Config/URLRegKey$&amp;lt;/Arguments&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;ScriptBody&amp;gt;&amp;lt;![CDATA['Arg1 = FQDN of Watcher Node &lt;BR&gt;'Arg2 = SourceID (MPElement) &lt;BR&gt;'Arg3 = ManagedEntityID (Target/Id) &lt;BR&gt;'Arg4 = Class ID &lt;BR&gt;'Arg5 = Property ID &lt;BR&gt;'Arg6 = URL Watcher reg key off hklm &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#c0c0c0&gt;Set oArgs = Wscript.Arguments &lt;BR&gt;sFQDN = UCase(oArgs(0)) &lt;BR&gt;sSourceID = oArgs(1) &lt;BR&gt;sManagedEntityID = oArgs(2) &lt;BR&gt;sClassID = oArgs(3) &lt;BR&gt;sPropertyID = oArgs(4) &lt;BR&gt;sURLRegKey = oArgs(5) &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#c0c0c0&gt;Set oAPI = CreateObject("MOM.ScriptAPI") &lt;BR&gt;Set oDiscoveryData = oAPI.CreateDiscoveryData(0,sSourceID, sManagedEntityID) &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#c0c0c0&gt;'Determine if this is a Watcher Node &lt;BR&gt;const HKEY_LOCAL_MACHINE = &amp;amp;H80000002 &lt;BR&gt;bIsWatcher = False &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#c0c0c0&gt;Set oReg = GetObject("winmgmts:root\default:StdRegProv") &lt;BR&gt;oReg.EnumValues HKEY_LOCAL_MACHINE, sURLRegKey, arrValues &lt;BR&gt;If isarray(arrValues) Then &lt;BR&gt;&amp;nbsp;&amp;nbsp; bIsWatcher = True &lt;BR&gt;End If &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#c0c0c0&gt;If bIsWatcher Then &lt;BR&gt;&amp;nbsp;&amp;nbsp; For Each sValue in arrValues &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oReg.GetStringValue HKEY_LOCAL_MACHINE, sURLRegKey, sValue, sURL &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set oWatcher = oDiscoveryData.CreateClassInstance(sClassID) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oWatcher.AddProperty "$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$",sFQDN &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oWatcher.AddProperty sPropertyID,sURL &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oWatcher.AddProperty "$MPElement[Name='System!System.Entity']/DisplayName$",sURL &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oDiscoveryData.AddInstance(oWatcher) &lt;BR&gt;&amp;nbsp;&amp;nbsp; Next &lt;BR&gt;End If &lt;BR&gt;Call oAPI.Return(oDiscoveryData)]]&amp;gt;&amp;lt;/ScriptBody&amp;gt; &lt;BR&gt;&amp;nbsp; &amp;lt;TimeoutSeconds&amp;gt;240&amp;lt;/TimeoutSeconds&amp;gt; &lt;BR&gt;&amp;lt;/ProbeAction&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;As you can see this is a vbscript that takes 5 arguments.&amp;nbsp; The script queries a registry key and if the key is found returns discovery data that is used by the discovery to create instances of the applicable class.&amp;nbsp; This is the reason we only need to create a handful of monitors to watch thousands of URLs.&lt;/P&gt;
&lt;P&gt;The Configuration Tab of the data source contains all the parameters that are passed into the data source by the discovery, which we will create next. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture8.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture8.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture8 border=0 alt=Capture8 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture8_thumb.jpg" width=604 height=544 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture8_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Data Types tab should show that this data source outputs discovery data. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture9.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture9.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture9 border=0 alt=Capture9 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture9_thumb.jpg" width=604 height=544 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture9_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Step 4 – Now I need to create the discovery that will use this data source.&amp;nbsp; I target the discovery to Microsoft.Windows.Computer because any computer can be a watcher.&amp;nbsp; The way the data source identifies a watcher is by the registry key we pass it. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture10.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture10.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture10 border=0 alt=Capture10 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture10_thumb.jpg" width=604 height=604 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture10_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Next I added the discovered types.&amp;nbsp; We are discovering instances of the SCCM MP Class so we just add that along with the appropriate attributes we will be populating. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture11.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture11.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture11 border=0 alt=Capture11 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture11_thumb.jpg" width=604 height=607 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture11_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Next I choose the data source we just created and plug in the appropriate parameters.&amp;nbsp; Notice the interval is set to every 24 hours and the URLRegKey is HKLM by default – Software\URLWatcher\SCCMMP.&amp;nbsp; So if the data source finds this registry key it will read the values underneath it.&amp;nbsp; The value should contain a URL like “&lt;A href="http://mysccmmp/sms_mp/.sms_aut?mplist" mce_href="http://mySCCMMP/sms_mp/.sms_aut?mplist"&gt;http://mySCCMMP/sms_mp/.sms_aut?mplist&lt;/A&gt;”. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/image_6.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/image_thumb_2.png" width=604 height=536 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;That is it for the class and discovery, just 4 steps (class, relationship, data source, and discovery).&amp;nbsp; To test this out add the following registry key and value to one of your OpsMgr agents and import the MP.&amp;nbsp; Note, you can add more registry values under this key if you want that agent to watch more than one URL in this particular class (so more than one SCCM MP). &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture13.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture13.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture13 border=0 alt=Capture13 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture13_thumb.jpg" width=604 height=434 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture13_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;After importing the MP you just created you should see new discovered, but not monitored, inventory of type “SCCM MP Class”.&amp;nbsp; Notice that the “Path” is actually the Watcher Node while the Display Name is the URL. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture14.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture14.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Capture14 border=0 alt=Capture14 src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture14_thumb.jpg" width=604 height=404 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/URLMonitoringPartIIClassesandDiscoveries_D7C7/Capture14_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9823148" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rslaten/archive/tags/SCCM+2007/default.aspx">SCCM 2007</category><category domain="http://blogs.msdn.com/rslaten/archive/tags/SCOM+2007/default.aspx">SCOM 2007</category></item><item><title>Custom URL Monitoring Part I – The Design</title><link>http://blogs.msdn.com/rslaten/archive/2009/07/07/custom-url-monitoring-part-i-the-design.aspx</link><pubDate>Wed, 08 Jul 2009 00:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9823144</guid><dc:creator>rslaten</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/rslaten/comments/9823144.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rslaten/commentrss.aspx?PostID=9823144</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rslaten/rsscomments.aspx?PostID=9823144</wfw:comment><description>&lt;P&gt;The out of the box Web Application template that exists in OpsMgr 2007 SP1 and R2 is useful but there are situations where it just doesn’t fit.&lt;/P&gt;
&lt;P&gt;Consider the following scenario: The Contoso Corporation’s global IT headquarters is located in Richardson, TX.&amp;nbsp; They have over 2,000 retail stores spread out across the world and over slow connections.&amp;nbsp; Each of these retail stores have two local servers.&amp;nbsp; One of these servers is a web server that hosts 3 web applications which are used for internal tools critical to the operation of the retail store.&amp;nbsp; The CIO wants the main page of SCCM Management Point site to be checked every 15 seconds to ensure the site is up.&amp;nbsp; She wants the POS Web Application site to be checked every 15 seconds to ensure it is responding within 500ms.&amp;nbsp; Finally, she also wants Store Inventory site to be checked for the text “store inventory web application” every 15 seconds to make sure the site is displaying the appropriate information.&amp;nbsp; Because of the remote nature of these retail stores the CIO wants the check to be done from the non-web server at each retail store where the websites are going to be viewed.&lt;/P&gt;
&lt;P&gt;The out-of-the-box Web Application template in OpsMgr doesn’t fit well in this scenario because we need to monitor 6,000 websites every 15 seconds from 2,000 different watcher nodes.&amp;nbsp; One of my customers has a very similar scenario in their environment and asked for a custom solution that uses OpsMgr.&amp;nbsp; I created a solution that does these checks every 15 seconds from the local watcher node at each retail store.&amp;nbsp; The cool part about this solution is we only use 3 monitors to watch all 6,000 web sites, it is dynamic so once the solution is in place there is very little additional administrative overhead, and it scales incredibly well.&lt;/P&gt;
&lt;P&gt;Because of the complexity of this management pack I decided to split this topic up into multiple blog entries.&amp;nbsp; The primary purpose of this series is to offer an alternative to the Web Application template in OpsMgr and the secondary purpose is to show how I developed this solution.&amp;nbsp; The series is broken up into the following posts:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/rslaten/archive/2009/07/07/custom-url-monitoring-part-i-the-design.aspx" mce_href="http://blogs.msdn.com/rslaten/archive/2009/07/07/custom-url-monitoring-part-i-the-design.aspx"&gt;Custom URL Monitoring Part I – The Design&lt;/A&gt; &lt;BR&gt;&lt;A href="http://blogs.msdn.com/rslaten/archive/2009/07/07/url-monitoring-part-ii-the-classes-and-discoveries.aspx" mce_href="http://blogs.msdn.com/rslaten/archive/2009/07/07/url-monitoring-part-ii-the-classes-and-discoveries.aspx"&gt;Custom URL Monitoring Part II – The Classes and Discoveries&lt;/A&gt; &lt;BR&gt;&lt;A href="http://blogs.msdn.com/rslaten/archive/2009/07/07/url-monitoring-part-iii-the-monitors.aspx" mce_href="http://blogs.msdn.com/rslaten/archive/2009/07/07/url-monitoring-part-iii-the-monitors.aspx"&gt;Custom URL Monitoring Part III – The Monitors&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;My design is generic and was designed for OpsMgr 2007 SP1 although it should also work in R2.&amp;nbsp; It consists of 3 discoveries, 3 classes, 3 monitors, 3 monitor types, and 4 data sources.&amp;nbsp; I attached the entire solution to this blog entry.&lt;/P&gt;
&lt;P&gt;Here is a diagram of the design of this MP:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/CustomURLMonitoringPart1TheDesign_D66B/URLMon_4.jpg" mce_href="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/CustomURLMonitoringPart1TheDesign_D66B/URLMon_4.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: block; FLOAT: none; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: auto; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: auto" title=URLMon border=0 alt=URLMon src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/CustomURLMonitoringPart1TheDesign_D66B/URLMon_thumb_1.jpg" width=495 height=978 mce_src="http://blogs.msdn.com/blogfiles/rslaten/WindowsLiveWriter/CustomURLMonitoringPart1TheDesign_D66B/URLMon_thumb_1.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;To test this MP in the lab do the following:&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; Create a test website with the text “store inventory web application” on the main page &lt;BR&gt;2.&amp;nbsp; On several OpsMgr agents (which would act as watcher nodes) create the following registry entries: &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp; HKLM\Software\URLWatcher\SCCMMP (Key) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp; HKLM\Software\URLWatcher\SCCMMP\SCCMMP:http://&amp;lt;yourwebsite&amp;gt; (String Value) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp; HKLM\Software\URLWatcher\POS (Key) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp; HKLM\Software\URLWatcher\POS\POS:http://&amp;lt;yourwebsite&amp;gt; (String Value) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp; HKLM\Software\URLWatcher\StoreInv (Key) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -&amp;nbsp; HKLM\Software\URLWatcher\StoreInv\StoreInv:http://&amp;lt;yourwebsite&amp;gt; (String Value) &lt;BR&gt;3.&amp;nbsp; Import the MP and wait 5 minutes &lt;BR&gt;4.&amp;nbsp; Under Monitoring\Discovered Inventory look at the 3 classes in the Website Watcher Library MP &lt;BR&gt;5.&amp;nbsp; Change the text and bring the website up/down to view the results&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9823144" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/rslaten/attachment/9823144.ashx" length="84314" type="application/octet-stream" /><category domain="http://blogs.msdn.com/rslaten/archive/tags/SCCM+2007/default.aspx">SCCM 2007</category><category domain="http://blogs.msdn.com/rslaten/archive/tags/SCOM+2007/default.aspx">SCOM 2007</category></item><item><title>New System Center Certifications</title><link>http://blogs.msdn.com/rslaten/archive/2007/10/12/new-system-center-certifications.aspx</link><pubDate>Sat, 13 Oct 2007 00:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5429268</guid><dc:creator>rslaten</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/rslaten/comments/5429268.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rslaten/commentrss.aspx?PostID=5429268</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rslaten/rsscomments.aspx?PostID=5429268</wfw:comment><description>&lt;P&gt;There will be a Live Meeting on October 24&lt;SUP&gt;th&lt;/SUP&gt; going over the new certifications for SCCM and SCOM. I will be adding these new certs to my list of things to do. See &lt;A href="http://blogs.msdn.com/trika/archive/2007/09/19/certifications-for-tsfkasms-mom.aspx" mce_href="http://blogs.msdn.com/trika/archive/2007/09/19/certifications-for-tsfkasms-mom.aspx"&gt;Trika's blog&lt;/A&gt; on the subject and for details on the Live Meeting.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5429268" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rslaten/archive/tags/SCCM+2007/default.aspx">SCCM 2007</category><category domain="http://blogs.msdn.com/rslaten/archive/tags/SCOM+2007/default.aspx">SCOM 2007</category></item><item><title>The Mystery of the Lost Hardware Inventory</title><link>http://blogs.msdn.com/rslaten/archive/2007/09/18/the-mystery-of-the-lost-hardware-inventory.aspx</link><pubDate>Tue, 18 Sep 2007 20:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4868994</guid><dc:creator>rslaten</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/rslaten/comments/4868994.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rslaten/commentrss.aspx?PostID=4868994</wfw:commentRss><wfw:comment>http://blogs.msdn.com/rslaten/rsscomments.aspx?PostID=4868994</wfw:comment><description>&lt;P&gt;In large environments, with tens of thousands of SMS 2003 clients, inventory may get "lost" for various reasons. An example of a lost inventory is below: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;An SMS 2003 Advanced Client reports a full inventory upon install &lt;/LI&gt;
&lt;LI&gt;The client continues to report delta inventory of changes &lt;/LI&gt;
&lt;LI&gt;The client reports a delta inventory but that inventory gets "lost" &lt;/LI&gt;
&lt;LI&gt;The client continues to report delta inventory but the changes in the "lost" inventory never appear in the database &lt;/LI&gt;
&lt;LI&gt;The client gets resync'd, sending up a full inventory, and the changes that were "lost" now appear &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;BR&gt;Clients don't get resync'd under normal conditions therefore that inventory may not ever appear in the database. This can become an issue for inventory items such as security updates (staying applicable in the database but not applicable on the client). System Center Configuration Manager 2007 contains architectural changes which prevent this scenario from occurring. Specifically SCCM 2007 serializes software and hardware inventory reporting so that missing reports, which are based on serial numbers instead of timestamps, trigger a re-synchronization of inventory at the client.&lt;BR&gt;&lt;BR&gt;So if you don't plan on upgrading to SCCM 2007 in the near future how might you prevent inventory from being "lost"? I documented some steps that should assist with detecting, and possibly resolving, the rare scenario when clients send up inventory that somehow disappears before getting loaded into the database. These steps are simply an example of how one might do this and the scripts are not tested and do not contain any type of error handling, logging, or reporting.&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Step # 1 – Modify the SMS_DEF.MOF &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Modify the Win32_OperatingSystem section of the MOF to report "LocalDateTime".&amp;nbsp; This is required because the "Workstation Status" section shows "Last Hardware Scan" but there isn't a way to keep the history of this data therefore we need a consistent time we can key in on that writes to a history table. &lt;/LI&gt;
&lt;LI&gt;
&lt;DIV&gt;Create a new class in the SMS_DEF.MOF to pick up a new WMI class which we'll create a populate later: &lt;/DIV&gt;
&lt;P style="MARGIN-LEFT: 18pt"&gt;//SMSInventoryHistory&lt;BR&gt;&amp;nbsp;[SMS_Report(TRUE),&lt;BR&gt;SMS_Group_Name("SMS Inventory"),&lt;BR&gt;SMS_Class_ID("MICROSOFT|SMS_INVENTORY|1.0"),&lt;BR&gt;Namespace("&lt;A href="file://root/SMSINVENTORY" mce_href="file:///\\root\SMSINVENTORY"&gt;\\\\\\\\.\\\\root\\\\SMSINVENTORY&lt;/A&gt;")]&lt;BR&gt;class InvHistory: SMS_Class_Template&lt;BR&gt;{&lt;BR&gt;[SMS_Report(TRUE),key]&lt;BR&gt;datetime&amp;nbsp;&amp;nbsp; ScanTime;&lt;BR&gt;[SMS_Report(TRUE)]&lt;BR&gt;uint32&amp;nbsp;&amp;nbsp; KeyIncrement;&lt;BR&gt;[SMS_Report(TRUE)]&lt;BR&gt;string&amp;nbsp;&amp;nbsp; ScanType;&lt;BR&gt;}; &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;Notice the KeyIncrement field.&amp;nbsp; This is there because we want to report every instance of this class for every inventory.&amp;nbsp; It is for this reason that we don't need history enabled for this class so it can be disabled by using &lt;A href="http://support.microsoft.com/kb/836432/en-us" mce_href="http://support.microsoft.com/kb/836432/en-us"&gt;KB836432&lt;/A&gt; (This still applies to SMS 2003 and likely SCCM 2007). &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Step # 2 – Create a recurring advertisement, which should probably run at least twice as often as hardware inventory (if not more), which runs client.vbs &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Creates a new "SMSInventory" class under "root" if it doesn't exist&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Gets the last hardware scan from root\ccm\invagt:InventoryActionStatus&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Creates a new instance of InvHistory in the SMSInventory namespace if the hardware scan is new&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;If the inventory is already recorded then update the "KeyIncrement" field so SMS reports this in every delta&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Cleans up any instances older than 14 days by default to keep the delta inventory from growing too large&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;DIV style="BORDER-RIGHT: 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: 1px solid; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; BORDER-LEFT: 1px solid; COLOR: #000000; PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid; BACKGROUND-COLOR: #c5c5c5"&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #696969"&gt;'client.vbs&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #696969"&gt;'rslaten&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #696969"&gt;'08/15/2007&lt;/SPAN&gt;

&lt;SPAN style="COLOR: #696969"&gt;'Determines when to clean out old inventory instances&lt;/SPAN&gt;
iDays &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;14&lt;/SPAN&gt;

&lt;SPAN style="COLOR: #696969"&gt;'Connect to WMI locally&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oLocator &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;CreateObject&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"WbemScripting.sWbemLocator"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oSvc &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oLocator&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;ConnectServer&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"root"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;

&lt;SPAN style="COLOR: #696969"&gt;'Create a custom namespace to hold data if it doesn't already exist&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oNamespaces &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oSvc&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;InstancesOf&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"__namespace"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
bFound &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0f4d75"&gt;False&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;For&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;each&lt;/SPAN&gt; oNamespace in oNamespaces
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; oNamespace&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Name&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"SMSInventory"&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
        bFound &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0f4d75"&gt;True&lt;/SPAN&gt;
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Exit&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;For&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Next&lt;/SPAN&gt;

&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Not&lt;/SPAN&gt; bFound &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oNamespace &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oSvc&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"__namespace"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oCustomNameSpace &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oNamespace&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;SpawnInstance_
    oCustomNamespace&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;name&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"SMSInventory"&lt;/SPAN&gt;
    oCustomNamespace&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Put_&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;

    &lt;SPAN style="COLOR: #696969"&gt;'Create a custom class to hold data&lt;/SPAN&gt;
    wbemCimtypeUint32 &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;19&lt;/SPAN&gt;
    wbemCimtypeDatetime &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;101&lt;/SPAN&gt;
    wbemCimtypeString &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;8&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oWMI &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;GetObject&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"winmgmts:root\SMSInventory"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oClass &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oWMI&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
    oClass&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Path_&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"InvHistory"&lt;/SPAN&gt;
    oClass&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Properties_&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;add &lt;SPAN style="COLOR: #0000e6"&gt;"ScanTime"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; wbemCimtypeDatetime
    oClass&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Properties_&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"ScanTime"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;.&lt;/SPAN&gt;Qualifiers_&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;add &lt;SPAN style="COLOR: #0000e6"&gt;"key"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0f4d75"&gt;true&lt;/SPAN&gt;
    oClass&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Properties_&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;add &lt;SPAN style="COLOR: #0000e6"&gt;"KeyIncrement"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; wbemCimtypeUint32
    oClass&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Properties_&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;add &lt;SPAN style="COLOR: #0000e6"&gt;"ScanType"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; wbemCimtypeString
    oClass&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Put_&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="COLOR: #696969"&gt;'Get timezone&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oSvc &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oLocator&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;ConnectServer&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"root\cimv2"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; collTimeZone &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oSvc&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;ExecQuery&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"select Bias, DaylightBias from Win32_TimeZone"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;For&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Each&lt;/SPAN&gt; oTimeZone in collTimeZone
    iTimeZone &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oTimeZone&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Bias &lt;SPAN style="COLOR: #808030"&gt;-&lt;/SPAN&gt; oTimeZone&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;DaylightBias
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Next&lt;/SPAN&gt;

&lt;SPAN style="COLOR: #696969"&gt;'Get last Hinv report date and convert to local time&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oSvc &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oLocator&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;ConnectServer&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"root\ccm\invagt"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
HActionID &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;""&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"{00000000-0000-0000-0000-000000000001}"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;""&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oHinv &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oSvc&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"InventoryActionStatus.InventoryActionID="&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
    HActionID&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Const&lt;/SPAN&gt; CONVERT_TO_LOCAL_TIME &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0f4d75"&gt;true&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #696969"&gt;'dLastReportDate = ConvertToGMT(oHinv.LastReportDate)&lt;/SPAN&gt;
dLastReportDate &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oHinv&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;LastReportDate
dLastReportDate &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; WMIDateStringToDate&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dLastReportDate&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; dNewTime &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;CreateObject&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"WbemScripting.SWbemDateTime"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
dNewTime&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;SetVarDate dLastReportDate&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; CONVERT_TO_LOCAL_TIME
dLastReportDate &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; dNewTime&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;GetVarDate&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;CONVERT_TO_LOCAL_TIME&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
dLastReportDate &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;DateAdd&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"n"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; iTimeZone&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; dLastReportDate&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
dLastReportDate &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; GetWMIDate&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dLastReportDate&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"+000"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;

&lt;SPAN style="COLOR: #696969"&gt;'Set last Hinv report date&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oSvc &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oLocator&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;ConnectServer&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"root\SMSInventory"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oHinvHistory &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oSvc&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;InstancesOf&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"InvHistory"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;

&lt;SPAN style="COLOR: #696969"&gt;'First instance in class&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; oHinvHistory&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Count &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;0&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oHinv &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oSvc&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"InvHistory"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;.&lt;/SPAN&gt;SpawnInstance_
    oHinv&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;ScanTime &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; dLastReportDate
    oHinv&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;KeyIncrement &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;0&lt;/SPAN&gt;
    oHinv&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;ScanType &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"Hardware"&lt;/SPAN&gt;
    oHinv&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Put_&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Else&lt;/SPAN&gt;
    bFound &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0f4d75"&gt;False&lt;/SPAN&gt;
    
    &lt;SPAN style="COLOR: #696969"&gt;'Calculate date to clean up old instances&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; dExpire &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;CreateObject&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"WbemScripting.SWbemDateTime"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
    dExpire&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;SetVarDate &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Now&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; CONVERT_TO_LOCAL_TIME
    dRegular &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; dExpire&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;GetVarDate&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;CONVERT_TO_LOCAL_TIME&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
    dExpireDate &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;DateAdd&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"d"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;-&lt;/SPAN&gt;iDays&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; dRegular&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
    dExpire&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;SetVarDate dExpireDate&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; CONVERT_TO_LOCAL_TIME
    
    &lt;SPAN style="COLOR: #696969"&gt;'Updating all instances&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;For&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;each&lt;/SPAN&gt; oInstance in oHinvHistory
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; dLastReportDate &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oInstance&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;ScanTime &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
            bFound &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0f4d75"&gt;True&lt;/SPAN&gt;
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
        
        &lt;SPAN style="COLOR: #696969"&gt;'Clean up old instances&lt;/SPAN&gt;
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; oInstance&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;ScanTime &lt;SPAN style="COLOR: #808030"&gt;&amp;lt;&lt;/SPAN&gt; dExpire &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
            oInstance&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Delete_
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Else&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #696969"&gt;'Increment the KeyIncrement property to force SMS to pick&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #696969"&gt;'up the instance during inventory&lt;/SPAN&gt;
            oInstance&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;KeyIncrement &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oInstance&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;KeyIncrement &lt;SPAN style="COLOR: #808030"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;1&lt;/SPAN&gt;
            oInstance&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Put_
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Next&lt;/SPAN&gt;
    
    &lt;SPAN style="COLOR: #696969"&gt;'Create a new instance if needed&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Not&lt;/SPAN&gt; bFound &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oHinv &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oSvc&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"InvHistory"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;.&lt;/SPAN&gt;SpawnInstance_
        oHinv&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;ScanTime &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; dLastReportDate
        oHinv&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;KeyIncrement &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;0&lt;/SPAN&gt;
        oHinv&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;ScanType &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"Hardware"&lt;/SPAN&gt;
        oHinv&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Put_&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;    
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;

&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Function&lt;/SPAN&gt; ConvertToGMT&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dDate&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
    ConvertToGMT &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; Replace&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dDate&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"-000"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; iTimeZone&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Function&lt;/SPAN&gt;

&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Function&lt;/SPAN&gt; WMIDateStringToDate&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dtmInstallDate&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
     WMIDateStringToDate &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;CDate&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Mid&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dtmInstallDate&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;5&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;2&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"/"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
     &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Mid&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dtmInstallDate&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;7&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;2&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"/"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Left&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dtmInstallDate&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;4&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
     &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;" "&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Mid&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dtmInstallDate&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;9&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;2&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;":"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
     &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Mid&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dtmInstallDate&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;11&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;2&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;":"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Mid&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dtmInstallDate&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
     &lt;SPAN style="COLOR: #008c00"&gt;13&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;2&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Function&lt;/SPAN&gt;

&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Function&lt;/SPAN&gt; GetWMIDate&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;vd&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt;strOffset&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;On&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Error&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Resume&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Next&lt;/SPAN&gt;
    GetWMIDate &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; Year&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;vd&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; AddZero&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Month&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;vd&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; AddZero&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;Day&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;vd&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
            AddZero&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Hour&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;vd&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; AddZero&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Minute&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;vd&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
            AddZero&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Second&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;vd&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;".000000"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; strOffset
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Function&lt;/SPAN&gt;

&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Function&lt;/SPAN&gt; AddZero&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;pNum&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;On&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Error&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Resume&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Next&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; pNum &lt;SPAN style="COLOR: #808030"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008c00"&gt;9&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;then&lt;/SPAN&gt;
        AddZero &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"0"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; pNum
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Else&lt;/SPAN&gt; AddZero &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; pNum
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Function&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;STRONG&gt;Step # 3 – Periodically check to see if there is any missing hardware inventory by running server.vbs &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Queries the SMS database for OS LocalDateTime and the custom SMSInventory ScanTime&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;Compares the ScanTime to LocalDateTime, searching for missing LocalDateTime entries.&amp;nbsp; To find a match the LocalDateTime must be within 5 minutes from the ScanTime.&amp;nbsp; If any clients take longer than 5 minutes to complete a hardware inventory cycle then this may need to be increased.&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;For any ScanTime without a matching LocalDateTime, we display the fact that there is a missing inventory.&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;DIV style="BORDER-RIGHT: 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: 1px solid; PADDING-LEFT: 4px; PADDING-BOTTOM: 1px; BORDER-LEFT: 1px solid; COLOR: #000000; PADDING-TOP: 1px; BORDER-BOTTOM: 1px solid; BACKGROUND-COLOR: #c5c5c5"&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #696969"&gt;'server.vbs&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #696969"&gt;'rslaten&lt;/SPAN&gt;
&lt;SPAN style="COLOR: #696969"&gt;'08/15/2007&lt;/SPAN&gt;

&lt;SPAN style="COLOR: #696969"&gt;'Globals&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Dim&lt;/SPAN&gt; aClients&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; iClients&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; iInstanceCount&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; iTotal

&lt;SPAN style="COLOR: #696969"&gt;'Get SMS Namespace&lt;/SPAN&gt;
sSMSNameSpace &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; GetSMSNameSpace&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;

&lt;SPAN style="COLOR: #696969"&gt;'Connect to site server&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oWMI &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;GetObject&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"winMgmts:"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; sSMSNameSpace&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;

&lt;SPAN style="COLOR: #696969"&gt;'Query clients and create and array of client objects&lt;/SPAN&gt;
sQuery &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"select distinct SMS_R_System.Name, SMS_R_System.SMSUniqueIdentifier,"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #0000e6"&gt;" SMS_G_System_SMS_INVENTORY.ScanTime, SMS_GH_System_OPERATING_SYSTEM.LocalDateTime"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #0000e6"&gt;" from  SMS_R_System inner join SMS_G_System_SMS_INVENTORY on "&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #0000e6"&gt;"SMS_G_System_SMS_INVENTORY.ResourceID = SMS_R_System.ResourceId inner"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #0000e6"&gt;" join SMS_GH_System_OPERATING_SYSTEM on "&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #0000e6"&gt;"SMS_GH_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId "&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #0000e6"&gt;"where SMS_G_System_SMS_INVENTORY.ScanTime is not NULL and "&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
    &lt;SPAN style="COLOR: #0000e6"&gt;"SMS_GH_System_OPERATING_SYSTEM.LocalDateTime is not NULL"&lt;/SPAN&gt;

&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; aCollection &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oWMI&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;ExecQuery&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;sQuery&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
iTotal &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; aCollection&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;count
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;For&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Each&lt;/SPAN&gt; oInstance In aCollection
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; sLastName &lt;SPAN style="COLOR: #808030"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;&amp;gt;&lt;/SPAN&gt; oInstance&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;SMS_R_System&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Name&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: #696969"&gt;'Make sure this isn't the first iteration in the array&lt;/SPAN&gt;
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; iInstanceCount &lt;SPAN style="COLOR: #808030"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;0&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #696969"&gt;'Add to master array&lt;/SPAN&gt;
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;ReDim&lt;/SPAN&gt; Preserve aClients&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;iClients&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; aClients&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;iClients&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oClient
            iClients &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; iClients &lt;SPAN style="COLOR: #808030"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;1&lt;/SPAN&gt;
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
        
        &lt;SPAN style="COLOR: #696969"&gt;'Now create new client object&lt;/SPAN&gt;
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oClient &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;New&lt;/SPAN&gt; Client
        oClient&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;sClient &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oInstance&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;SMS_R_System&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Name&lt;/SPAN&gt;
        oClient&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;sGUID &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oInstance&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;SMS_R_System&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;SMSUniqueIdentifier
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
    
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; sLastScan &lt;SPAN style="COLOR: #808030"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;&amp;gt;&lt;/SPAN&gt; oInstance&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;SMS_G_System_SMS_Inventory&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;ScanTime &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
        oClient&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;AddSMSInventoryScanDate&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;oInstance&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;SMS_G_System_SMS_Inventory&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;ScanTime&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
    
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; sLastOSScan &lt;SPAN style="COLOR: #808030"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;&amp;gt;&lt;/SPAN&gt; oInstance&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;SMS_GH_System_OPERATING_SYSTEM&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;LocalDateTime &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
        oClient&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;AddOSScanDate&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;oInstance&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;SMS_GH_System_OPERATING_SYSTEM&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;LocalDateTime&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; 

    sLastName &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oInstance&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;SMS_R_System&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Name&lt;/SPAN&gt;
    sLastScan &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oInstance&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;SMS_G_System_SMS_Inventory&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;ScanTime
    sLastOSScan &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oInstance&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;SMS_GH_System_OPERATING_SYSTEM&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;LocalDateTime
    iInstanceCount &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; iInstanceCount &lt;SPAN style="COLOR: #808030"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;1&lt;/SPAN&gt;
    
    &lt;SPAN style="COLOR: #696969"&gt;'If this is the last instance add it to the array&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; iInstanceCount &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; iTotal &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: #696969"&gt;'Add to master array&lt;/SPAN&gt;
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;ReDim&lt;/SPAN&gt; Preserve aClients&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;iClients&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; aClients&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;iClients&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oClient
        iClients &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; iClients &lt;SPAN style="COLOR: #808030"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;1&lt;/SPAN&gt;    
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Next&lt;/SPAN&gt;

&lt;SPAN style="COLOR: #696969"&gt;'Loop through clients in memory to check for missing inventory&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;For&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;each&lt;/SPAN&gt; oClient in aClients
    aScans &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oClient&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;aScans
    WScript&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Echo &lt;SPAN style="COLOR: #0000e6"&gt;"******************************************"&lt;/SPAN&gt;
    WScript&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Echo &lt;SPAN style="COLOR: #0000e6"&gt;"Client = "&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; oClient&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;sClient
    WScript&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Echo &lt;SPAN style="COLOR: #0000e6"&gt;"GUID = "&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; oClient&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;sGUID
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;For&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;each&lt;/SPAN&gt; oScan in oClient&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;aScans
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;not&lt;/SPAN&gt; oScan&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;isOS &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oMatch &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;new&lt;/SPAN&gt; Match
            oMatch&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;dScan &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; WMIDateStringToDate&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;oScan&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;dDate&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
            oMatch&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;bMatch &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0f4d75"&gt;false&lt;/SPAN&gt;
            
            &lt;SPAN style="COLOR: #696969"&gt;'Find a matching OS time (look for match within 5 minutes)&lt;/SPAN&gt;
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;For&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;each&lt;/SPAN&gt; oTime in aScans
                &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; oTime&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;isOS &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
                    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;DateDiff&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"n"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; oMatch&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;dScan&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
                        WMIDateStringToDate&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;oTime&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;dDate&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;lt;&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;5&lt;/SPAN&gt; and &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
                        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;DateDiff&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"n"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; oMatch&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;dScan&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
                        WMIDateStringToDate&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;oTime&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;dDate&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008c00"&gt;5&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;             
                        oMatch&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;dOS &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; WMIDateStringToDate&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;oTime&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;dDate&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
                        oMatch&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;bMatch &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0f4d75"&gt;true&lt;/SPAN&gt;
                    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
                &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Next&lt;/SPAN&gt;
            
            &lt;SPAN style="COLOR: #696969"&gt;'Make sure we found a match&lt;/SPAN&gt;
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;not&lt;/SPAN&gt; oMatch&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;bMatch &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
                WScript&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Echo &lt;SPAN style="COLOR: #0000e6"&gt;"*PROBLEM FOUND*"&lt;/SPAN&gt;
                WScript&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Echo &lt;SPAN style="COLOR: #0000e6"&gt;"SMS Inventory Report = "&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; oMatch&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;dScan
                WScript&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Echo &lt;SPAN style="COLOR: #0000e6"&gt;"*NO MATCHING OS DATE FOUND*"&lt;/SPAN&gt;
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Else&lt;/SPAN&gt;
                WScript&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Echo oMatch&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;dScan &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;" = "&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; oMatch&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;dOS
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Next&lt;/SPAN&gt;
    WScript&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;Echo &lt;SPAN style="COLOR: #0000e6"&gt;"******************************************"&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Next&lt;/SPAN&gt;

&lt;SPAN style="COLOR: #696969"&gt;'Get regular date&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Function&lt;/SPAN&gt; WMIDateStringToDate&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dtmInstallDate&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
    WMIDateStringToDate &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;CDate&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Mid&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dtmInstallDate&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;5&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;2&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"/"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Mid&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dtmInstallDate&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;7&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;2&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;"/"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Left&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dtmInstallDate&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;4&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
            &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;" "&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Mid&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dtmInstallDate&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;9&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;2&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;":"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
                &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Mid&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dtmInstallDate&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;11&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;2&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000e6"&gt;":"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Mid&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dtmInstallDate&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
                    &lt;SPAN style="COLOR: #008c00"&gt;13&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;,&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;2&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Function&lt;/SPAN&gt;


&lt;SPAN style="COLOR: #696969"&gt;'Gets SMS Namespace from local site server&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Function&lt;/SPAN&gt; GetSMSNameSpace&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; refWMI &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;GetObject&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"winMgmts:\root\sms"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;    
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; colNameSpaceQuery &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; refWMI&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;ExecQuery&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000e6"&gt;"select * from SMS_ProviderLocation"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;For&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Each&lt;/SPAN&gt; refitem in colNameSpaceQuery
        GetSMSNameSpace &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; refitem&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;NamespacePath
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Function&lt;/SPAN&gt;

&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Class&lt;/SPAN&gt; Client
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Public&lt;/SPAN&gt; aScans&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Private&lt;/SPAN&gt; i
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Public&lt;/SPAN&gt; sClient
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Public&lt;/SPAN&gt; sGUID
    
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Sub&lt;/SPAN&gt; AddOSScanDate&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dScanDate&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: #696969"&gt;'Check for duplicates&lt;/SPAN&gt;
        bFound &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0f4d75"&gt;false&lt;/SPAN&gt;
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;For&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Each&lt;/SPAN&gt; oScan in aScans
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; dScanDate &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oScan&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;dDate And &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
                oScan&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;isOS &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0f4d75"&gt;true&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
                bFound &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0f4d75"&gt;true&lt;/SPAN&gt;
                &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Exit&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;For&lt;/SPAN&gt;
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Next&lt;/SPAN&gt;
        
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Not&lt;/SPAN&gt; bFound &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oScan &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;New&lt;/SPAN&gt; Scan
            oScan&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;dDate &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; dScanDate
            oScan&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;isOS &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0f4d75"&gt;true&lt;/SPAN&gt;
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;ReDim&lt;/SPAN&gt; Preserve aScans&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;i&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; aScans&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;i&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oScan
            i &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; i &lt;SPAN style="COLOR: #808030"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;1&lt;/SPAN&gt;
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Sub&lt;/SPAN&gt;
    
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Sub&lt;/SPAN&gt; AddSMSInventoryScanDate&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;dScanDate&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
        &lt;SPAN style="COLOR: #696969"&gt;'Check for duplicates&lt;/SPAN&gt;
        bFound &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0f4d75"&gt;false&lt;/SPAN&gt;
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;For&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Each&lt;/SPAN&gt; oScan in aScans
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; dScanDate &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oScan&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;dDate And &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;_&lt;/SPAN&gt;
                oScan&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;isOS &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0f4d75"&gt;false&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;
                bFound &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0f4d75"&gt;true&lt;/SPAN&gt;
                &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Exit&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;For&lt;/SPAN&gt;
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Next&lt;/SPAN&gt;
        
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Not&lt;/SPAN&gt; bFound &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Then&lt;/SPAN&gt;        
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; oScan &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;New&lt;/SPAN&gt; Scan
            oScan&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;dDate &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; dScanDate
            oScan&lt;SPAN style="COLOR: #008c00"&gt;.&lt;/SPAN&gt;isOS &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0f4d75"&gt;false&lt;/SPAN&gt;
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;ReDim&lt;/SPAN&gt; Preserve aScans&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;i&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt;
            &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Set&lt;/SPAN&gt; aScans&lt;SPAN style="COLOR: #808030"&gt;(&lt;/SPAN&gt;i&lt;SPAN style="COLOR: #808030"&gt;)&lt;/SPAN&gt; &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; oScan
            i &lt;SPAN style="COLOR: #808030"&gt;=&lt;/SPAN&gt; i &lt;SPAN style="COLOR: #808030"&gt;+&lt;/SPAN&gt; &lt;SPAN style="COLOR: #008c00"&gt;1&lt;/SPAN&gt;    
        &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;If&lt;/SPAN&gt;
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Sub&lt;/SPAN&gt;
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Class&lt;/SPAN&gt;

&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Class&lt;/SPAN&gt; Scan
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Public&lt;/SPAN&gt; dDate
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Public&lt;/SPAN&gt; isOS
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Class&lt;/SPAN&gt;

&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Class&lt;/SPAN&gt; Match
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Public&lt;/SPAN&gt; dScan
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Public&lt;/SPAN&gt; dOS
    &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Public&lt;/SPAN&gt; bMatch
&lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;End&lt;/SPAN&gt; &lt;SPAN style="FONT-WEIGHT: bold; COLOR: #800000"&gt;Class&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;STRONG&gt;Step # 4 – Force a resync on the clients that have "lost" inventory &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The method to delete the local inventory cache is the &lt;A href="http://www.microsoft.com/technet/prodtechnol/sms/sms2003/maintain/smsscript/script31.mspx?mfr=true" mce_href="http://www.microsoft.com/technet/prodtechnol/sms/sms2003/maintain/smsscript/script31.mspx?mfr=true"&gt;known and documented method&lt;/A&gt; of doing this. &lt;/LI&gt;
&lt;LI&gt;There may be a way to use the MP API to create a server side policy, but this would require significant work and a non-script (C++) application.&amp;nbsp; Internally, as you can see with SQL profiler, we execute the sp_RC_InvResync stored procedure but as you know executing these directly isn't recommended or supported. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;These examples do not contain error checking and need to be optimized for performance.&amp;nbsp; The examples have also only been tested in a very small test environment using only the scenario documented at the top of this post.&amp;nbsp; If this method is to be used in a production environment more code work and testing needs to be done, particularly on the server end, to improve the detection logic, add history to which clients resyncs have been sent to, and add reporting capabilities. &lt;/P&gt;
&lt;P&gt;**Steps 3 and 4 might not be required.&amp;nbsp; During testing I found a potentially unforeseen benefit of running the client.vbs script on clients with "lost" inventory.&amp;nbsp; Since every instance of the InvHistory class is reported during every inventory, when an instance is listed as "Update" but isn't in the database, dataloader will automatically request a resync for that client.&amp;nbsp; More testing of this finding needs to be done to verify that this will work, and if it does it should simplify detecting which clients have lost inventory** &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4868994" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rslaten/archive/tags/SMS+2003/default.aspx">SMS 2003</category><category domain="http://blogs.msdn.com/rslaten/archive/tags/SCCM+2007/default.aspx">SCCM 2007</category></item></channel></rss>