0

I'm using pstools to shutdown local pcs .. with different user & pass

psshutdown \\10.0.0.1  -u 1 -p 1
psshutdown \\10.0.0.2  -u 2 -p 2 
psshutdown \\10.0.0.3  -u 3 -p 3 

problem is : if one of them is down the batch take a lot of time to move to the next one ... How can i skip to the next command after some time .. or but it in a loop ... Any ideas ?

D007a
  • 1
  • 1
  • 2
    Upgrade to using Powershell, use one of the various [runspace implementations](https://github.com/RamblingCookieMonster/Invoke-Parallel) that let you mutlitask and run many commands in parallel? – Zoredache Apr 17 '17 at 23:26

1 Answers1

0

According to the docs, you can set a timeout for connecting to the remote machine with the -n <seconds> option:

psshutdown \\10.0.0.1  -u 1 -p 1 -n 5
jordanm
  • 889
  • 5
  • 9