<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: SCOM 2007 Script to Monitor File Count inside a Directory</title>
	<atom:link href="http://www.scom2k7.com/scom-2007-script-to-monitor-file-count-inside-a-directory/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scom2k7.com/scom-2007-script-to-monitor-file-count-inside-a-directory/</link>
	<description></description>
	<lastBuildDate>Tue, 27 Jul 2010 20:16:33 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Tim</title>
		<link>http://www.scom2k7.com/scom-2007-script-to-monitor-file-count-inside-a-directory/comment-page-1/#comment-5184</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Tue, 27 Apr 2010 23:23:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.scom2k7.com/?p=52#comment-5184</guid>
		<description>In the script you must use something like 

Call oBag.AddValue(&quot;ret&quot;,strReturn)
Call oBag.AddValue(&quot;ret2&quot;,strReturn2)

Then in the description you would add somthing like this
$Data/Context/Property[@Name=&#039;ret&#039;]$
$Data/Context/Property[@Name=&#039;ret&#039;2]$</description>
		<content:encoded><![CDATA[<p>In the script you must use something like </p>
<p>Call oBag.AddValue(&#8220;ret&#8221;,strReturn)<br />
Call oBag.AddValue(&#8220;ret2&#8243;,strReturn2)</p>
<p>Then in the description you would add somthing like this<br />
$Data/Context/Property[@Name='ret']$<br />
$Data/Context/Property[@Name='ret'2]$</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nix</title>
		<link>http://www.scom2k7.com/scom-2007-script-to-monitor-file-count-inside-a-directory/comment-page-1/#comment-4434</link>
		<dc:creator>nix</dc:creator>
		<pubDate>Mon, 15 Feb 2010 09:23:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.scom2k7.com/?p=52#comment-4434</guid>
		<description>Hi,

Thx for your script, i could adapt it and test it in my MP.
But i have a question : 
In the Alerting part, in the alert description box, I tried this  :
&quot;Test : 
$Property[@Name=&#039;ret&#039;]$
$Data/Context/Property[@Name=&#039;ret&#039;]$
$Property[@Name=&#039;State&#039;]$
$Data/Context/Property[@Name=&#039;State&#039;]$
&quot;

but in the alert description, I only get 

&quot;Test : 

{0}
{1}
{2}
{3}&quot;

Do you know how I can get strings contained in the oBag ??

Regards.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thx for your script, i could adapt it and test it in my MP.<br />
But i have a question :<br />
In the Alerting part, in the alert description box, I tried this  :<br />
&#8220;Test :<br />
$Property[@Name='ret']$<br />
$Data/Context/Property[@Name='ret']$<br />
$Property[@Name='State']$<br />
$Data/Context/Property[@Name='State']$<br />
&#8221;</p>
<p>but in the alert description, I only get </p>
<p>&#8220;Test : </p>
<p>{0}<br />
{1}<br />
{2}<br />
{3}&#8221;</p>
<p>Do you know how I can get strings contained in the oBag ??</p>
<p>Regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.scom2k7.com/scom-2007-script-to-monitor-file-count-inside-a-directory/comment-page-1/#comment-2517</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Tue, 25 Aug 2009 01:01:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.scom2k7.com/?p=52#comment-2517</guid>
		<description>Not sure there are a few things wrong with it.

Download this one.  http://www.scom2k7.com/downloads/countnumberoffileswithscom.zip</description>
		<content:encoded><![CDATA[<p>Not sure there are a few things wrong with it.</p>
<p>Download this one.  <a href="http://www.scom2k7.com/downloads/countnumberoffileswithscom.zip" rel="nofollow">http://www.scom2k7.com/downloads/countnumberoffileswithscom.zip</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug</title>
		<link>http://www.scom2k7.com/scom-2007-script-to-monitor-file-count-inside-a-directory/comment-page-1/#comment-2516</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Mon, 24 Aug 2009 21:58:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.scom2k7.com/?p=52#comment-2516</guid>
		<description>I&#039;m getting the following error when the script runs. 

The process started at 2:52:48 PM failed to create System.PropertyBagData. Errors found in output:

C:\Program Files\System Center Operations Manager 2007\Health Service State\Monitoring Host Temporary Files 39\546\CheckFolder.vbs(13, 25) Microsoft VBScript compilation error: Invalid character

I think it&#039;s referencing the following line:Set oBag = oAPI.CreateTypedPropertyBag(StateDataType)

Here&#039;s what I have in my script.  Any ideas?


                &#039; Enter a script that outputs a property bag
                &#039; Example VBScript:
                &#039;
                &#039; Dim oAPI, oBag
                &#039; Set oAPI = CreateObject(&quot;MOM.ScriptAPI&quot;)
                &#039; Set oBag = oAPI.CreatePropertyBag()
                &#039; Call oBag.AddValue(&quot;Status&quot;,&quot;OK&quot;)
                &#039; Call oAPI.Return(oBag)

On Error Resume Next

Dim oAPI, oBag, objFSO, objFldr
Set oAPI = CreateObject(“MOM.ScriptAPI“)
Set oBag = oAPI.CreateTypedPropertyBag(StateDataType)
Set oArgs = WScript.Arguments 
MessageText = “” 
If oArgs.Count Then 
Call oAPI.LogScriptEvent(“Check.Folder.vbs”, 500, 0, “Script aborted. Not enough parameters provided.”)
WScript.Quit -1
End If 
strFldr = oArgs(0)
NumberOfFiles = int(oArgs(1)) 
Set objFSO=CreateObject(“Scripting.FileSystemObject”)
Set objFldr=objFSO.GetFolder(strFldr)
If objFldr.Files.Count &gt; NumberOfFiles Then
strReturn = “Number of Files in “ &amp; strFldr&amp; ” is greater than “ &amp; NumberOfFiles
Call oBag.AddValue(“State”,“BAD”)
Call oBag.AddValue(“ret“,strReturn)

Else 
Call oBag.AddValue(“State”,“GOOD”)

End If 
Call oAPI.Return(oBag)</description>
		<content:encoded><![CDATA[<p>I&#8217;m getting the following error when the script runs. </p>
<p>The process started at 2:52:48 PM failed to create System.PropertyBagData. Errors found in output:</p>
<p>C:\Program Files\System Center Operations Manager 2007\Health Service State\Monitoring Host Temporary Files 39\546\CheckFolder.vbs(13, 25) Microsoft VBScript compilation error: Invalid character</p>
<p>I think it&#8217;s referencing the following line:Set oBag = oAPI.CreateTypedPropertyBag(StateDataType)</p>
<p>Here&#8217;s what I have in my script.  Any ideas?</p>
<p>                &#8216; Enter a script that outputs a property bag<br />
                &#8216; Example VBScript:<br />
                &#8216;<br />
                &#8216; Dim oAPI, oBag<br />
                &#8216; Set oAPI = CreateObject(&#8220;MOM.ScriptAPI&#8221;)<br />
                &#8216; Set oBag = oAPI.CreatePropertyBag()<br />
                &#8216; Call oBag.AddValue(&#8220;Status&#8221;,&#8221;OK&#8221;)<br />
                &#8216; Call oAPI.Return(oBag)</p>
<p>On Error Resume Next</p>
<p>Dim oAPI, oBag, objFSO, objFldr<br />
Set oAPI = CreateObject(“MOM.ScriptAPI“)<br />
Set oBag = oAPI.CreateTypedPropertyBag(StateDataType)<br />
Set oArgs = WScript.Arguments<br />
MessageText = “”<br />
If oArgs.Count Then<br />
Call oAPI.LogScriptEvent(“Check.Folder.vbs”, 500, 0, “Script aborted. Not enough parameters provided.”)<br />
WScript.Quit -1<br />
End If<br />
strFldr = oArgs(0)<br />
NumberOfFiles = int(oArgs(1))<br />
Set objFSO=CreateObject(“Scripting.FileSystemObject”)<br />
Set objFldr=objFSO.GetFolder(strFldr)<br />
If objFldr.Files.Count &gt; NumberOfFiles Then<br />
strReturn = “Number of Files in “ &amp; strFldr&amp; ” is greater than “ &amp; NumberOfFiles<br />
Call oBag.AddValue(“State”,“BAD”)<br />
Call oBag.AddValue(“ret“,strReturn)</p>
<p>Else<br />
Call oBag.AddValue(“State”,“GOOD”)</p>
<p>End If<br />
Call oAPI.Return(oBag)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.scom2k7.com/scom-2007-script-to-monitor-file-count-inside-a-directory/comment-page-1/#comment-20</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Mon, 10 Mar 2008 16:47:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scom2k7.com/?p=52#comment-20</guid>
		<description>How do I configure the run as account to work with this monitor? THe network share is on an AS400 that is not part of the domain.</description>
		<content:encoded><![CDATA[<p>How do I configure the run as account to work with this monitor? THe network share is on an AS400 that is not part of the domain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Timothy McFadden</title>
		<link>http://www.scom2k7.com/scom-2007-script-to-monitor-file-count-inside-a-directory/comment-page-1/#comment-18</link>
		<dc:creator>Timothy McFadden</dc:creator>
		<pubDate>Sat, 08 Mar 2008 04:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scom2k7.com/?p=52#comment-18</guid>
		<description>That is because you will need to use a run-as account to connect to a network share.  Everything by default runs as local system.  Local system doesn&#039;t have access to your network shares.</description>
		<content:encoded><![CDATA[<p>That is because you will need to use a run-as account to connect to a network share.  Everything by default runs as local system.  Local system doesn&#8217;t have access to your network shares.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.scom2k7.com/scom-2007-script-to-monitor-file-count-inside-a-directory/comment-page-1/#comment-17</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Fri, 07 Mar 2008 23:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.scom2k7.com/?p=52#comment-17</guid>
		<description>This sample works great on a local folder but does not work on a network shared folder. If I put anything in the network folder an alert is generate no matter what the parameter count. Any ideas on using a script on a network shared folder?</description>
		<content:encoded><![CDATA[<p>This sample works great on a local folder but does not work on a network shared folder. If I put anything in the network folder an alert is generate no matter what the parameter count. Any ideas on using a script on a network shared folder?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
