<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TechColumnist &#187; script</title>
	<atom:link href="http://www.techcolumnist.com/wp/tag/script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techcolumnist.com/wp</link>
	<description>Storage Information Blog</description>
	<lastBuildDate>Fri, 16 Jul 2010 15:56:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>ISY Python Script for controlling media lights via xbmc</title>
		<link>http://www.techcolumnist.com/wp/2010/07/16/isy-python-script-for-controlling-media-lights-via-xbmc/</link>
		<comments>http://www.techcolumnist.com/wp/2010/07/16/isy-python-script-for-controlling-media-lights-via-xbmc/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 15:55:36 +0000</pubDate>
		<dc:creator>Tom Lasswell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[isy]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[xbmc]]></category>

		<guid isPermaLink="false">http://www.techcolumnist.com/wp/?p=245</guid>
		<description><![CDATA[Here is a simple python script to use the REST code in the ISY (http://universal-devices.com) to control devices that are linked. I'm designing this script to be used inside a script for xbmc. here's the first part of it. I recommend using scenes for the devicedim, deviceoff, and deviceon array, however you can use the [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple python script to use the REST code in the ISY (http://universal-devices.com) to control devices that are linked. I'm designing this script to be used inside a script for xbmc. here's the first part of it. I recommend using scenes for the devicedim, deviceoff, and deviceon array, however you can use the individual devices as well in the array.</p>
<p>[python]</p>
<p>import urllib2<br />
import urllib<br />
import sys</p>
<p>devicedim = ['41941']<br />
deviceoff = ['48839']<br />
deviceon = ['62270']<br />
username = 'admin'<br />
password = 'admin'</p>
<p>topurl = 'http://isy'<br />
passman = urllib2.HTTPPasswordMgrWithDefaultRealm()<br />
passman.add_password(None, topurl, username, password)<br />
authhandler = urllib2.HTTPBasicAuthHandler(passman)<br />
opener = urllib2.build_opener(authhandler)<br />
urllib2.install_opener(opener)</p>
<p>if sys.argv[1] == 'playing':<br />
	for devicex in deviceoff:<br />
		theurl = 'http://isy/rest/nodes/' + devicex + '/cmd/DOF'<br />
		#normalize the URL<br />
		theurl = urllib.quote(theurl, safe="%/:=&#038;?~#+!$,;'@()*[]")<br />
		print (theurl)<br />
		pagehandle = urllib2.urlopen(theurl)<br />
	for devicex in devicedim:<br />
		theurl = 'http://isy/rest/nodes/' + devicex + '/cmd/DON/64'<br />
		#normalize the URL<br />
		theurl = urllib.quote(theurl, safe="%/:=&#038;?~#+!$,;'@()*[]")<br />
		print (theurl)<br />
		pagehandle = urllib2.urlopen(theurl)<br />
elif sys.argv[1] == 'stopped':<br />
	for devicex in deviceon:<br />
		print (devicex)<br />
		theurl = 'http://isy/rest/nodes/' + devicex + '/cmd/DON'<br />
		#normalize the URL<br />
		theurl = urllib.quote(theurl, safe="%/:=&#038;?~#+!$,;'@()*[]")<br />
		print (theurl)<br />
		pagehandle = urllib2.urlopen(theurl)<br />
else:<br />
	print 'no state given'<br />
[/python]</p>
<p>Usage: [plain]isy-medialights.py playing|stopped[/plain]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techcolumnist.com/wp/2010/07/16/isy-python-script-for-controlling-media-lights-via-xbmc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Schedule a URL into Maintenance Mode</title>
		<link>http://www.techcolumnist.com/wp/2010/07/07/schedule-a-url-into-maintenance-mode/</link>
		<comments>http://www.techcolumnist.com/wp/2010/07/07/schedule-a-url-into-maintenance-mode/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 22:53:54 +0000</pubDate>
		<dc:creator>Tom Lasswell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[SCOM]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.techcolumnist.com/wp/?p=212</guid>
		<description><![CDATA[Found a nice article about how to script a URL (or web application) into maintenance mode. This was a little bit of a challenge to find so I'm reposting it to hopefully get some more attention. I've also posted the modified version of the script that allows for multiple watcher hosts. [powershell]param($rootMS,$urlName,$minutes,$comment,$reason) Add-PSSnapin "Microsoft.EnterpriseManagement.OperationsManager.Client" -ErrorVariable [...]]]></description>
			<content:encoded><![CDATA[<p>Found a nice article about how to script a URL (or web application) into maintenance mode. This was a little bit of a challenge to find so I'm reposting it to hopefully get some more attention. I've also posted the modified version of the script that allows for multiple watcher hosts.</p>
<p>[powershell]param($rootMS,$urlName,$minutes,$comment,$reason)<br />
Add-PSSnapin "Microsoft.EnterpriseManagement.OperationsManager.Client" -ErrorVariable errSnapin;</p>
<p>Set-Location "OperationsManagerMonitoring::" -ErrorVariable errSnapin;<br />
new-managementGroupConnection -ConnectionString:$rootMS -ErrorVariable errSnapin;<br />
set-location $rootMS -ErrorVariable errSnapin;</p>
<p>$URLWatcher = (Get-MonitoringClass -name Microsoft.SystemCenter.WebApplication.Perspective) | Get-MonitoringObject | where {$_.DisplayName -eq $urlName}</p>
<p>$startTime = [System.DateTime]::Now<br />
$endTime = $startTime.AddMinutes($minutes)</p>
<p>"Putting URL into maintenance mode"<br />
foreach ($name in $URLWatcher) {<br />
New-MaintenanceWindow -startTime:$startTime -endTime:$endTime -monitoringObject:$name -comment:$comment -Reason:$reason }[/powershell]</p>
<h3><strong>Usage:</strong></h3>
<p>[bash]C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe URLMaintenanceModeV4.ps1 -rootMS: `SCOMRMS1′ -urlName: ‘MSN Website Checker’ -minutes:45 -comment: ‘My Comment’ -reason: ‘PlannedOther’[/bash]</p>
<p><a href="http://www.scom2k7.com/schedule-a-into-url-maintenance-mode/">http://www.scom2k7.com/schedule-a-into-url-maintenance-mode/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techcolumnist.com/wp/2010/07/07/schedule-a-url-into-maintenance-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script: Check for Orphaned HomeDirs</title>
		<link>http://www.techcolumnist.com/wp/2009/07/07/script-check-for-orphaned-homedirs/</link>
		<comments>http://www.techcolumnist.com/wp/2009/07/07/script-check-for-orphaned-homedirs/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 03:49:43 +0000</pubDate>
		<dc:creator>Tom Lasswell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.techcolumnist.com/wp/?p=116</guid>
		<description><![CDATA[It seems no matter how much you try you cannot ever get those damned orphaned homedirs cleaned up. Well, this helps. Our org always has additional groups in the homedir (no, we don't just let the users have whatever they want in there, so we have to monitor). This causes a little confusion amongst most [...]]]></description>
			<content:encoded><![CDATA[<p>It seems no matter how much you try you cannot ever get those damned orphaned homedirs cleaned up. Well, this helps. Our org always has additional groups in the homedir (no, we don't just let the users have whatever they want in there, so we have to monitor). This causes a little confusion amongst most orphaned file checkers (as there is still a group in there that resolves). Read on for the code and an example.</p>
<p>What this script does is it scans a directory's subdirectories (as with many homedirs, the subdirectories are usually the AD account name). It then tries to match the subdirectory to an AD account name. If this proves that one doesn't exist, it prompts and spits out the ACL info and a prompt to move the files. If you say yes, it moves them to the directory you specified in arg1.</p>
<p><span id="more-116"></span><br />
[vb]'Example: cscript orphaned-files.vbs "T:\" "T:\~archive"  where T:\ is a mapped drive<br />
strDomain = "dc=yourdomain,dc=com"<br />
strFromDir = wscript.arguments(0)<br />
strToDir = wscript.arguments(1)<br />
Set FSO = CreateObject("Scripting.FileSystemObject")<br />
ShowSubfolders FSO.GetFolder(strFromDir)<br />
Sub ShowSubFolders(Folder)<br />
    For Each Subfolder in Folder.SubFolders<br />
        'Wscript.Echo Subfolder.Path<br />
  sUserName = replace(Subfolder.Path, strFromDir,"")<br />
  UserExist(sUserName)<br />
    Next<br />
End Sub<br />
Sub UserExist(sUserName)<br />
 dtStart = TimeValue(Now())<br />
 Set objConnection = CreateObject("ADODB.Connection")<br />
 objConnection.Open "Provider=ADsDSOObject;"<br />
 Set objCommand = CreateObject("ADODB.Command")<br />
 objCommand.ActiveConnection = objConnection<br />
 objCommand.CommandText = _<br />
  "&lt;LDAP://" &amp; strDomain &amp; "&gt;;(&amp;(objectCategory=User)" &amp; _<br />
    "(samAccountName=" &amp; sUserName &amp; "));samAccountName;subtree"<br />
 Set objRecordSet = objCommand.Execute<br />
 If objRecordset.RecordCount = 0 Then<br />
  WScript.Echo "*******************sAMAccountName: " &amp; sUserName &amp; " does not exist."<br />
  DisplayACLS(sUserName)<br />
 End If<br />
 objConnection.Close<br />
End Sub<br />
Sub DisplayACLS(sUserName)<br />
 Set objShell = CreateObject("WScript.Shell")<br />
 Set objWshScriptExec = objShell.Exec("ICACLS " &amp; strFromDir &amp; sUserName &amp; "")<br />
 Set objStdOut = objWshScriptExec.StdOut<br />
 strLine = objStdOut.ReadAll<br />
 Wscript.Echo strLine<br />
 intAnswer = _<br />
    Msgbox("Do you want to move these files?", _<br />
        vbYesNo, "Move Files")<br />
 If intAnswer = vbYes Then<br />
  MoveFiles(sUserName)<br />
 Else<br />
  wscript.echo "Skipping Files"<br />
  wscript.echo "*******************"<br />
 End If<br />
End Sub<br />
Sub MoveFiles(sUserName)<br />
 wscript.echo "Moving Files"<br />
 wscript.echo "*******************"<br />
 Set wshShell = WScript.CreateObject ("WScript.shell")<br />
 rc=wshShell.run("cmd /c robocopy """ &amp; strFromDir &amp; sUserName &amp; """ """ &amp; strToDir &amp; sUserName &amp; """ /S /E /MOVE /COPY:DAT /V /NP /NFL /ZB /R:3 /W:3 /TEE",1,False)<br />
 Set wshShell = nothing<br />
End Sub[/vb]</p>
<h3>Example Output:</h3>
<p>[plain]*******************sAMAccountName: username does not exist.<br />
S:\username BUILTIN\Administrators:(OI)(CI)(F)<br />
         CREATOR OWNER:(OI)(CI)(IO)(F)<br />
         (OI)(CI)(F)<br />
Successfully processed 1 files; Failed processing 0 files<br />
Moving Files<br />
*******************[/plain]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techcolumnist.com/wp/2009/07/07/script-check-for-orphaned-homedirs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Preparing for SCCM &#8211; enabling Secure Key Exchange</title>
		<link>http://www.techcolumnist.com/wp/2008/03/02/preparing-for-sccm-enabling-secure-key-exchange/</link>
		<comments>http://www.techcolumnist.com/wp/2008/03/02/preparing-for-sccm-enabling-secure-key-exchange/#comments</comments>
		<pubDate>Mon, 03 Mar 2008 03:21:59 +0000</pubDate>
		<dc:creator>Tom Lasswell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ConfigMgr]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.techcolumnist.com/wp/2008/03/02/preparing-for-sccm-enabling-secure-key-exchange/</guid>
		<description><![CDATA[I found this interesting forum post on the msft forums. This code will help you change all your sites to require secure key exchange. here's the post: http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2796017&#38;SiteID=17 on error resume next ' Setup a connection to the local provider. Set swbemLocator = CreateObject("WbemScripting.SWbemLocator") Set swbemServices= swbemLocator.ConnectServer(".", "root\sms") Set providerLoc = swbemServices.InstancesOf("SMS_ProviderLocation") For Each Location In providerLoc If location.ProviderForLocalSite [...]]]></description>
			<content:encoded><![CDATA[<p>I found this interesting forum post on the msft forums. This code will help you change all your sites to require secure key exchange.</p>
<p>here's the post: <a href="http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2796017&amp;SiteID=17">http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=2796017&amp;SiteID=17</a></p>
<p><span id="more-45"></span></p>
<p><code>on error resume next<br />
' Setup a connection to the local provider.<br />
Set swbemLocator = CreateObject("WbemScripting.SWbemLocator")<br />
Set swbemServices= swbemLocator.ConnectServer(".", "root\sms")<br />
Set providerLoc = swbemServices.InstancesOf("SMS_ProviderLocation")<br />
For Each Location In providerLoc<br />
If location.ProviderForLocalSite = True Then<br />
Set swbemServices = swbemLocator.ConnectServer(Location.Machine, "root\sms\site_" + Location.SiteCode)<br />
siteCode = Location.SiteCode<br />
Exit For<br />
End If<br />
Next</code></p>
<p><code>Set swbemContext = CreateObject("WbemScripting.SWbemNamedValueSet")<br />
swbemContext.Add "SessionHandle", swbemServices.ExecMethod("SMS_SiteControlFile", "GetSessionHandle").SessionHandle</code></p>
<p><code>' How to list the site security mode from the site control file.<br />
Call SetSecureKeyExchange(swbemServices, swbemContext, siteCode, 0)<br />
Sub SetSecureKeyExchange(swbemServices, _<br />
swbemContext, _<br />
siteCode, _<br />
enableDisableFlag)</code></p>
<p><code>' Load site control file and get the SMS_SCI_SiteDefinition section.<br />
swbemServices.ExecMethod "SMS_SiteControlFile.Filetype=1,Sitecode=""" &amp; siteCode &amp; """", "Refresh", , , swbemContext Query = "SELECT * FROM SMS_SCI_SiteDefinition " &amp; _<br />
"WHERE ItemName = 'Site Definition' " &amp; _<br />
"AND SiteCode = '" &amp; siteCode &amp; "'"</code></p>
<p><code>' Get the Site Definition properties.<br />
Set SCIComponentSet = swbemServices.ExecQuery(Query, ,wbemFlagForwardOnly Or wbemFlagReturnImmediately, swbemContext)</code></p>
<p><code>'Only one instance is returned from the query.<br />
For Each SCIComponent In SCIComponentSet<br />
'Loop through the array of embedded SMS_EmbeddedProperty instances.<br />
For Each vProperty In SCIComponent.Props<br />
' Setting: Allow unknown child sites aka check the box<br />
' require secure key exchange<br />
If vProperty.PropertyName = "Allow unknown child sites" Then<br />
wscript.echo "Site Code: " &amp; SiteCode<br />
wscript.echo vProperty.PropertyName<br />
wscript.echo "Current value: " &amp; vProperty.Value<br />
wscript.echo "Resetting value to: " &amp; enableDisableFlag</code></p>
<p><code>' modify the value<br />
vProperty.Value = enableDisableFlag</code></p>
<p><code>' Save the properties<br />
SCIComponent.Put_ , swbemContext<br />
End If<br />
Next<br />
Next</code></p>
<p><code>'Commit any changes to the actual site control file.<br />
Set InParams = swbemServices.Get("SMS_SiteControlFile").Methods_("CommitSCF").InParameters.SpawnInstance_<br />
InParams.SiteCode = siteCode<br />
swbemServices.ExecMethod "SMS_SiteControlFile", "CommitSCF", InParams, , swbemContext</code></p>
<p><code>' Release the copy of the site control file.<br />
swbemServices.Get("SMS_SiteControlFile").ReleaseSessionHandle swbemContext.Item("SessionHandle").Value<br />
End Sub </code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techcolumnist.com/wp/2008/03/02/preparing-for-sccm-enabling-secure-key-exchange/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change SMS Cache Size</title>
		<link>http://www.techcolumnist.com/wp/2007/10/20/change-sms-cache-size/</link>
		<comments>http://www.techcolumnist.com/wp/2007/10/20/change-sms-cache-size/#comments</comments>
		<pubDate>Sat, 20 Oct 2007 08:54:17 +0000</pubDate>
		<dc:creator>Tom Lasswell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sms2003]]></category>

		<guid isPermaLink="false">http://www.techcolumnist.com/wp/2007/10/20/change-sms-cache-size/</guid>
		<description><![CDATA[This script will change the sms cache size. Usage Example: cscript change-sms-cache.vbs 1000 d:\ Note: size is in MB [vb]On Error Resume Nextssize = WScript.Arguments(0) slocation = WScript.Arguments(1) Set oUIResource = CreateObject("UIResource.UIResourceMgr") Set CacheInfo = oUIResource.GetCacheInfo cacheInfo.TotalSize = sSize if WScript.Arguments(1) then CacheInfo.Location = sLocation End if[/vb]]]></description>
			<content:encoded><![CDATA[<p>This script will change the sms cache size.<br />
Usage Example: <code>cscript change-sms-cache.vbs 1000 d:\</code><br />
Note: size is in MB</p>
<p><span id="more-21"></span></p>
<p>[vb]On Error Resume<br />
Nextssize = WScript.Arguments(0)<br />
slocation = WScript.Arguments(1)<br />
Set oUIResource = CreateObject("UIResource.UIResourceMgr")<br />
Set CacheInfo = oUIResource.GetCacheInfo</p>
<p>cacheInfo.TotalSize = sSize</p>
<p>if WScript.Arguments(1) then<br />
CacheInfo.Location = sLocation<br />
End if[/vb]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techcolumnist.com/wp/2007/10/20/change-sms-cache-size/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check for reboot</title>
		<link>http://www.techcolumnist.com/wp/2007/08/24/check-for-reboot/</link>
		<comments>http://www.techcolumnist.com/wp/2007/08/24/check-for-reboot/#comments</comments>
		<pubDate>Fri, 24 Aug 2007 09:37:52 +0000</pubDate>
		<dc:creator>Tom Lasswell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://techcolumnist.com/wp/?p=10</guid>
		<description><![CDATA[call checkpendingstatus sub CheckPendingStatus Set ComputerStatus = CreateObject("Microsoft.Update.SystemInfo") If ComputerStatus.RebootRequired Then wscript.echo "This computer has a pending reboot." Else wscript.echo "this computer does not have a pending reboot." End If End sub]]></description>
			<content:encoded><![CDATA[<p><code>call checkpendingstatus<br />
</code><code>sub </code><code>CheckPendingStatus<br />
Set ComputerStatus = CreateObject("Microsoft.Update.SystemInfo")<br />
If ComputerStatus.RebootRequired Then<br />
wscript.echo "This computer has a pending reboot."<br />
Else<br />
wscript.echo "this computer does not have a pending reboot."<br />
End If<br />
End sub</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techcolumnist.com/wp/2007/08/24/check-for-reboot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ping a list of machines from txt</title>
		<link>http://www.techcolumnist.com/wp/2007/08/09/ping-a-list-of-machines-from-txt/</link>
		<comments>http://www.techcolumnist.com/wp/2007/08/09/ping-a-list-of-machines-from-txt/#comments</comments>
		<pubDate>Thu, 09 Aug 2007 09:41:58 +0000</pubDate>
		<dc:creator>Tom Lasswell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://techcolumnist.com/wp/?p=12</guid>
		<description><![CDATA[This vbscript pings machines from a text file: change the two variables for your input and output txt files: strPATHout = "C:\pingstatus.txt" strPATHin = "C:\pinglist.txt" ON ERROR Resume Next 'Define log paths (disable in portions if not using a reference file) strPATHout = "C:\#active\pingstatus.txt" strPATHin = "C:\#active\pinglist.txt" 'Define additional variables here sMsgboxtxt = "ping?" 'message [...]]]></description>
			<content:encoded><![CDATA[<p>This vbscript pings machines from a text file:</p>
<p>change the two variables for your input and output txt files:<br />
strPATHout = "C:\pingstatus.txt"<br />
strPATHin = "C:\pinglist.txt"</p>
<p><span id="more-12"></span></p>
<p><code>ON ERROR Resume Next</p>
<p>'Define log paths (disable in portions if not using a reference file)<br />
strPATHout = "C:\#active\pingstatus.txt"<br />
strPATHin = "C:\#active\pinglist.txt"</p>
<p>'Define additional variables here<br />
sMsgboxtxt = "ping?" 'message box text here<br />
sMsgboxttl = "ping?" 'message box title here<br />
sLogTitle = "ping?" 'log file title string</p>
<p>'Standard message stating whether you want to do this or not<br />
intReturn = Msgbox(sMsgboxtxt, vbYesNo, sMsgboxttl)<br />
    If intReturn = vbNo Then<br />
        Wscript.echo "Quitting"<br />
        WScript.quit<br />
    End If</p>
<p>'Create filesystem objects (comment out OBJin if not using reference file)<br />
Set OBJfs = CreateObject("Scripting.FileSystemObject")<br />
Set OBJin = OBJfs.OpenTextFile(strPATHin)<br />
Set OBJout = OBJfs.CreateTextFile(strPATHout,True)</p>
<p>OBJout.WriteLine(sLogTitle &#038; " - " &#038; Now)</p>
<p>Do Until OBJin.AtEndOfStream<br />
   strComputer = lcase(OBJin.Readline)</p>
<p>pingstatus = Ping(strComputer)<br />
OBJout.WriteLine(strComputer &#038; "," &#038; pingstatus)<br />
wscript.echo strComputer &#038; "," &#038; pingstatus</p>
<p>Loop</p>
<p>function Ping(sComputer)<br />
    dim objShell, objPing, strPingOut, flag<br />
    set objShell = CreateObject("Wscript.Shell")<br />
    set objPing = objShell.Exec("ping -n 3 -w 1000 "&#038; sComputer)<br />
    strPingOut = objPing.StdOut.ReadAll<br />
    if instr(LCase(strPingOut), "reply") then<br />
        flag = TRUE<br />
 if instr(LCase(strPingOut), "destination host unreachable") then<br />
 flag = FALSE<br />
 end if<br />
        else<br />
            flag = FALSE<br />
        end if<br />
        Ping = flag<br />
end function<br />
'close the file<br />
OBJout.Close()<br />
OBJin.Close()<br />
Wscript.echo "Quitting"</p>
<p>' Quit the Script ----------------------------------------------------<br />
WScript.quit</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.techcolumnist.com/wp/2007/08/09/ping-a-list-of-machines-from-txt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
