﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>New Boundary Support Forum / Prism Deploy &amp; Prism Pack / Tips and Tricks  / Script to do on demand polling / Latest Posts</title><generator>InstantForum.NET v4.1.3</generator><description>New Boundary Support Forum</description><link>http://www.nbtnet.newboundary.com/forum/</link><webMaster>support@newboundary.com</webMaster><lastBuildDate>Thu, 17 May 2012 07:30:43 GMT</lastBuildDate><ttl>20</ttl><item><title>Script to do on demand polling</title><link>http://www.nbtnet.newboundary.com/forum/Topic1310-8-1.aspx</link><description>Hi again &lt;/P&gt;&lt;P&gt;here is another handy script if you have long polling time set on the channel and quickly want computers to poll the channel.&lt;/P&gt;&lt;P&gt;//Janne&lt;/P&gt;&lt;P&gt;'Author Janne Carlsson &lt;BR&gt;'Simple script to make a range of computers poll their channel&lt;BR&gt;'You need admin status on the remote computers. &lt;BR&gt;'In prism console do a computer status report and sort on example attended and export to excel&lt;BR&gt;'use the function Auto filter on for example the colum client status to get the machine attended copy the list of computernames to an txt file&lt;BR&gt;'save it as computers.ini in folder "C:\Script\Prism"&lt;BR&gt;'&lt;BR&gt;'Cmdfile the file that executes on remote computer&lt;BR&gt;'inifile the file that contains computernames to do the poll&lt;BR&gt;'psexecfile the location of psexec &lt;BR&gt;'&lt;BR&gt;'The script uses psexec from pstools by &lt;A href="http://www.systeminternals.com/"&gt;http://www.systeminternals.com/&lt;/A&gt;&lt;BR&gt;'Script start&lt;BR&gt;'Path to files used by the script&lt;BR&gt;psexecfile = "C:\Script\Prism\psexec.exe"&lt;BR&gt;cmdfile = """C:\Program Files\Script\pollchannel.cmd"""&lt;BR&gt;inifile = "C:\Script\Prism\computers.ini"&lt;BR&gt;'&lt;BR&gt;'random function so that not overload the server&lt;BR&gt;intMax = 1 'seconds&lt;BR&gt;intMin = 5 'seconds&lt;BR&gt;Randomize&lt;BR&gt;intWait = Int((intMax - intMin + 1) * Rnd + intMin)&lt;BR&gt;'&lt;BR&gt;Set WshShell = WScript.CreateObject("WScript.Shell")&lt;BR&gt;Set objFS=CreateObject ("Scripting.FileSystemObject")&lt;BR&gt;set listFile = objFS.OpenTextFile (inifile)&lt;/P&gt;&lt;P&gt;do while listFile.AtEndOfStream &amp;lt;&amp;gt; True &lt;BR&gt; computer1 = (listFile.ReadLine)&lt;BR&gt; run = WshShell.run ( psexecfile &amp;amp; " " &amp;amp;  "\\" &amp;amp; computer1 &amp;amp;  " -i -n 5 " &amp;amp; cmdfile)&lt;BR&gt; 'WScript.Echo( psexecfile &amp;amp; " " &amp;amp;  "\\" &amp;amp; computer1 &amp;amp;  " -i -n 5 " &amp;amp; cmdfile)&lt;BR&gt;'Wait abit &lt;BR&gt; WScript.Sleep intWait * 1000&lt;BR&gt;Loop&lt;/P&gt;&lt;P&gt;wscript.echo "Finished"</description><pubDate>Fri, 02 Jun 2006 06:06:47 GMT</pubDate><dc:creator>JanneC</dc:creator></item></channel></rss>
