Page 2 of 2

Re: two background jobs colision

Posted: Wed Jan 13, 2016 6:09 am
by noescape
jvierra wrote:
noescape wrote:Thanks for useful information, it makes sense. I figured it out myself but I'm glad it was the right place to stop the timer.
Here is how to run a continuous background ping against multiple computers. It will run until you stop the job. You can use a timer to poll the job and display/update the status of the computers. Other tasks can just test the status. I use read only checkboxes to display status and se the color. If checked the computer is online and responding.

Code: Select all

workflow pingall {
foreach -parallel($c in $computers) {
Test-Connection $c -Count 1
sleep 2
pingall 'omega', 'w8test', 'alpha'
pingall 'omega', 'w8test', 'alpha' -asjob -JobName PingAll

Perfect, I was experimenting with parallel workflow before but couldn't get it to update my form controls correctly. In my form I also use a datagridview with readonly checkbox column to display status of queried stations so that should be easy to set up.
Thanks a lot for this piece of code.