Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Workflow timeout issue?

$
0
0

Hi

Found a nice little introduction to workflows and the foreach -parallel construct. I thought that would come in very handy for a script that pings a lot of servers to see if any are down. So I clobbered it together, fed it a list of 700 servers and sat back please with myself that it would finish in a fraction of the time.

Didn't work. Ran for quite a few of them (and clearly in parallel judging by the way the output came back), but then:

The operation did not complete within the allotted timeout of 00:00:30. The time allotted to this
operation may have been a portion of a longer timeout.
At Parallel-Ping:15 char:15++ CategoryInfo          : InvalidResult: (:) [], TimeoutException+ FullyQualifiedErrorId : JobStateFailed

Here's the code I used, any way to change the length of timeout? Google not really helping me here. Or perhaps some better way to accomplish this? A fast parallel-ping of such a large list of objects?

workflow Parallel-Ping {

  param(

	[string[]]$Computers,
	[boolean]$DownOnly

  )

  foreach -parallel ($computer in $computers) {

    if (!(Test-Connection -ComputerName $computer -Count 1 -ErrorAction SilentlyContinue)) {
		"$Computer is DOWN"
	} else {
		if (!($DownOnly)) { "$Computer is UP"}
	}
  }

}

$Computers = Get-Content servers.txt
Parallel-Ping $Computers

Thanks !

A


Viewing all articles
Browse latest Browse all 2562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>