Nick_Parker Posted October 16, 2013 Posted October 16, 2013 Has anybody ever experienced an issue with running .bat files on Server 2008 R2 where they seem to run at an absolute crawl? I have 4 batch files which I use to shutdown/restart the labs and sometimes when I run them they seem to run at a snails pace taking up to 10 minutes to complete. In the attached screenshot you can see I am attempting to restart 3 of the labs and the scripts have been running for nearly 10 minutes so far?
kmount Posted October 16, 2013 Posted October 16, 2013 I wouldn't do it like that, I'd fork each shutdown/restart process into it's own process so they run almost in parallel instead of sequential. Try adding "start" at the front of each of your commands to see if that helps.
Nick_Parker Posted October 16, 2013 Author Posted October 16, 2013 Thanks @kmount, I'll give it a try! Just an update - The scripts took nearly 40 minutes to run and shutdown 100 PCs.
kmount Posted October 16, 2013 Posted October 16, 2013 Thanks @kmount, I'll give it a try! Just an update - The scripts took nearly 40 minutes to run and shutdown 100 PCs. That's a long old time, I suspect it is because it's connecting to each one in turn and sending it a hello, please shutdown whereas I'm suggesting it goes and asks 100 of them simultaneously to do it so each conversation can take as long as it wants because there's 100 going on at once. (maybe 100 is too many but you'll find a figure that fits)
RobBaxter Posted October 16, 2013 Posted October 16, 2013 I know i sound like a advert bot, however, Impero is a GOD SEND for this kinda stuff. Just saying 1
Nick_Parker Posted October 16, 2013 Author Posted October 16, 2013 I gave the START thing a try, it did seem to execute much quicker, however, it's still causing an issue somewhere because I tried to open a command prompt window straight after running it and it took 2 minutes before I actually had a prompt. I then typed a ping command and it sat for a minute before it resolved and actually sent the ping.
Nick_Parker Posted October 16, 2013 Author Posted October 16, 2013 I know i sound like a advert bot, however, Impero is a GOD SEND for this kinda stuff. Just saying I shall have a look see 1
kmount Posted October 16, 2013 Posted October 16, 2013 I gave the START thing a try, it did seem to execute much quicker, however, it's still causing an issue somewhere because I tried to open a command prompt window straight after running it and it took 2 minutes before I actually had a prompt. I then typed a ping command and it sat for a minute before it resolved and actually sent the ping. Ah yes, it is probably battering your server to do these naughty things. You may find running it in batches of 10 is nicer to it, maybe like: START yadda machine1 START yadda machine2 START yadda machine3 START yadda machine4 START yadda machine5 (all of the way to 10) SLEEP 30 (so it stops doing stuff for 30 seconds to let the above run through) START yadda machine11 etc.
mac_shinobi Posted October 16, 2013 Posted October 16, 2013 Not sure how much difference this would make but I presume you are running the command prompt with elevated access rights ie run as admin?
Duke5A Posted October 16, 2013 Posted October 16, 2013 (edited) You should be using psexec for this; it's part of the Sysinternals Utilities suite and is a free download through Microsoft. Sysinternals Utilities Drop each computer name in a text file on its own line and run it some like this: psexec @PCList.txt -d "shutdown -r t 0" It'll start the shutdown process client side all at the same time. You may need to play around with command switches to tweak it, but I use this utility all the time to refresh group policy en mass amongst other things. BTW - are the clients XP? Edited October 16, 2013 by Duke5A 1
DMcCoy Posted October 16, 2013 Posted October 16, 2013 It's just waiting for a dns/rpc timeout, around 30 seconds for each computer that isn't resolvable/responding. If they were all *on* and dns is working/scavenged then it wouldn't take long. As everyone else has said, best to run the commands in parallel if you want it quick. Although the time taken doesn't actually mean anything is broken
free780 Posted October 16, 2013 Posted October 16, 2013 Could just deploy a scheduled tssk to shut them down.
Nick_Parker Posted October 17, 2013 Author Posted October 17, 2013 Not sure how much difference this would make but I presume you are running the command prompt with elevated access rights ie run as admin? Yep, being run as Administrator
Nick_Parker Posted October 17, 2013 Author Posted October 17, 2013 It's just waiting for a dns/rpc timeout, around 30 seconds for each computer that isn't resolvable/responding. If they were all *on* and dns is working/scavenged then it wouldn't take long. As everyone else has said, best to run the commands in parallel if you want it quick. Although the time taken doesn't actually mean anything is broken Trying out the START command now
Nick_Parker Posted October 17, 2013 Author Posted October 17, 2013 (edited) You should be using psexec for this; it's part of the Sysinternals Utilities suite and is a free download through Microsoft. Sysinternals Utilities Drop each computer name in a text file on its own line and run it some like this: psexec @PCList.txt -d "shutdown -r t 0" It'll start the shutdown process client side all at the same time. You may need to play around with command switches to tweak it, but I use this utility all the time to refresh group policy en mass amongst other things. BTW - are the clients XP? Thanks @Duke5A, I'll give it a try And no, they're all Windows 7 Edited October 17, 2013 by Nick_Parker Forgot some info.
Michael Posted October 17, 2013 Posted October 17, 2013 Here's how I do it A request is sent to all PCs immediately. 1
mac_shinobi Posted October 17, 2013 Posted October 17, 2013 @Michael Just curious if powdamonkey or whatever his eg handle is continued with shutdownertron ??
Michael Posted October 18, 2013 Posted October 18, 2013 @Michael Just curious if powdamonkey or whatever his eg handle is continued with shutdownertron ?? It still exists here, however I see no need seeing as it can all be achieved with GPP (as I descried above). 1
mac_shinobi Posted October 18, 2013 Posted October 18, 2013 It still exists here, however I see no need seeing as it can all be achieved with GPP (as I descried above). GPP Method is very sleak !! Loving that method !!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now