How to get my PsExec gpupdate 'for' command to execute concurrently

I currently have a very simple batch file that I use to do a 'gpupdate' on my 45 XenApp servers.  What I have is...

for /f %%i in (\\server\software\Batches\XEN##.txt) do \\server\software\Batches\PsExec.exe \\%%i gpupdate

and then in the XEN##.txt file I have a list of my 45 servers.

This works great, however it can only do it sequentially, i.e. it takes more than 30 seconds to finish the gpupdate on XEN01, and only then will it begin the gpupdate on XEN02, so of course it takes almost 30 mins to finish doing all of them.

Is there a way to restructure the above so that the gpupdate command runs simultaneuosly on all the 45 servers?

meirionwylltSenior Desktop EngineerAsked:
Who is Participating?
Abhi PappiTechnical Lead - Network SupportCommented:

Have you tried to use a "-d" switch for the task to "Don't wait for process to terminate (non-interactive)"?


meirionwylltSenior Desktop EngineerAuthor Commented:
Excellent!  That worked.  Thanks.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.