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?