Documentation for PsExec is here. It says to use the -n
parameter to specify a timeout connecting to the server. This seems like it would solve the issue of the server being unavailable.
ipconfig
should be a fast call so I don't know that you would need to do anything else but passing a list of files to psexec
means it'll run them one by one. If you need even "faster" results then don't pass a list of computers to the command but instead use Powershell's parallel capability to start a separate psexec process/job for each computer (or batch if there are a lot of them) and let them run in parallel. You can read more about that here. To give you an idea of the impact suppose you had 10 servers and each one took 1 second to run your command. The total time would be 10 seconds (+ overhead). However if you started them all at once (within limits) then they would run concurrently and potentially be done in 1 second (+ overhead).