Avatar of meirionwyllt
meirionwyllt
 asked on

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?

Thanks.
CitrixWindows BatchWindows Server 2008

Avatar of undefined
Last Comment
meirionwyllt

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Abhilash Pappiyil

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
meirionwyllt

ASKER
Excellent!  That worked.  Thanks.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes