silver Posted March 23, 2009 Posted March 23, 2009 (edited) I am trying to shut down all the computers at 6.30pm and I don't know if I have done it right. I have written the following in notepad: shutdown -s -m \\Computer name shutdown -s -m \\computer name 2 (etc etc) Renamed to a .bat file. Saved somewhere sensible. Added a scheduled task. Pointed it at the file. As a test, I repeated the exercise with one machine but set it to run in 5 minutes time. It didn't. What have I done wrong?? Edited March 23, 2009 by silver
powdarrmonkey Posted March 23, 2009 Posted March 23, 2009 shutdown -s -m \\computername Or, of course, Shutdownertron can handle all this for you.
dyoung5 Posted March 23, 2009 Posted March 23, 2009 Hi Silver. I tried to do this some months back and found that if you run a scheduled task, it runs under a system account (can't remember which one), which doesn't have permission to shut the system down IIRC. We got round it by using the group policy "allowed to shut down system" which I think is under computer>security>local security policy. Add system, local service and network service plus any groups you want to allow to shut down the system, e.g. admins, staff, etc. This was a while ago so I might have go everything compleatly wrong. I gave up in the end after hitting some other problems, and we now use Shutdownatron (Edugeek project) which is amazing and works really well with minimal config. I definately suggest you look at Shutdownatron, as it will probably do what you want. David Edit: I see powdarrmonkey got a plug in before I posted
silver Posted March 23, 2009 Author Posted March 23, 2009 (edited) Thanks I have tried to look at shutdownertron but I'm afraid I didn't understand what I had to do (told you I was stupid) The installation manual presumed a level of competence with AD and group policy that I just haven't got (I am trying but it is difficult when you are on your own) Maybe someone can tell me in words of one syllable? Edited March 23, 2009 by silver
mrbios Posted March 23, 2009 Posted March 23, 2009 Theres a nifty little program called specops remote admin, integrates with AD on just your machine, it can be used to shutdown, restart, power up (if WOL is enabled) PCs You can also set it up on a schedule but you have to buy the extended version in order to do that, very easy to use, theres lots of free programs that do the same thing but i found this one the best for simplicity and it "just works" opposed to the fiddling i find with some free programs
srochford Posted March 23, 2009 Posted March 23, 2009 As a test, I repeated the exercise with one machine but set it to run in 5 minutes time. It didn't. What have I done wrong?? @powdarrmonkey has pointed out the layout but other than that it should be OK. How are you creating the scheduled task - if you use the "at" command then it does try to run under local system and that has no access to the networked machines. If you go to control panel and add a scheduled task then it will prompt you for a username and password. I've always used a special account which has domain admin privileges for this purpose but as long as the account you use would be able to shut down a machine then there's no problem. Try adding a couple of extra lines to the file: echo Starting > %windir%\temp\shutdown.log echo about to do machine1 >> %windir%\temp\shutdown.log shutdown -s -m \\computername1 echo about to do machine2 >> %windir%\temp\shutdown.log shutdown -s -m \\computername2 then schedule the task for 5 minutes time. Take a look in c:\windows\temp for a file called shutdown.log - it should include some info about the process starting etc; that will at least confirm that it's starting etc finally, if you just type shutdown -s -m \\computername1 then does that work? if that doesn't work then it certainly won't work when you schedule it :-)
silver Posted March 23, 2009 Author Posted March 23, 2009 (edited) Thanks mrbios but can't buy anything at the moment Going back to shutdownertron, I understand the installation on the server and template stuff. I begin to lose the plot during the client installation: Do i just put out the same MSI as on the server or what. And what on earth are MSI transforms?? Some help and some clarification as to exactly what I have to do to get the thing installed on the machines would be very helpful. As for shutdown - I ran 'add a scheduled task' and it asked me for my administrator password so I would have thought permissions were OK as that is the account that can do everything everywhere. I will try the other ideas Edited March 23, 2009 by silver
silver Posted March 23, 2009 Author Posted March 23, 2009 Right I had done the layout right, I just wrote it down wrong on here. Shutting down a machine from the server didn't work until I added the domain name after the computer name - why, I don't know Then I ran a single machine shutdown in 5 mins time and that worked (with domain name) So I have added the domain name to the long list of computers and hope that that will work tonight. As I won't be here when they shut down and others will have turned them on long before I get here tomorrow - where can I go to see if they were shut down or not??
powdarrmonkey Posted March 23, 2009 Posted March 23, 2009 Going back to shutdownertron, I understand the installation on the server and template stuff. I begin to lose the plot during the client installation: Do i just put out the same MSI as on the server or what. And what on earth are MSI transforms?? Some help and some clarification as to exactly what I have to do to get the thing installed on the machines would be very helpful. Yes, deploy the same MSI as you did on the server - both sets are in the same installer, to avoid confusion (although, perhaps it just increases it ) If you're not particularly confident deploying it through group policy, you could do it on each machine, but obviously that's much more hard work. Don't worry about the transforms - they're to customise the installation for you, but the defaults will do just fine. I'll revise the installation guide to make this a bit better. If you get really stuck, shout me.
kennysarmy Posted March 23, 2009 Posted March 23, 2009 my script is thus: @echo off REM Copies shutdown executable to local computer from network location and sets shutdown times in Scheduled Tasks. REM Script also checks for name of pc and if found to be a server ie fp* does not copy file or add tasks. @set str=%computername% @set pos12=%str:~0,2% @echo %pos12% REM If computer name starts FP* ie one of the servers then do nothing if %pos12%==FP goto End REM If computer name starts IL* ie the ILIBRA server then do nothing if %pos12%==IL goto End REM Else carry out adding tasks below if not exist "c:\shutdown.exe" copy "\\fp4\shapps\shutdown\shutdown.exe" c:\ at /delete /yes at 09:10 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER." at 10:10 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER." at 11:05 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER." at 11:30 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER." at 12:30 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER." at 13:30 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER." at 14:15 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER." at 14:45 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER." at 15:45 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER." at 16:45 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER." at 18:00 /interactive /every:M,T,W,Th,F,S,Su c:\shutdown.exe -i -s shutdown -f -l 30 -m "SHUTTING DOWN INACTIVE COMPUTER." :END It only shuts down computers with no one logged on and does this throughout the day... if you want a copy of the shutdown.exe give me a shout.
srochford Posted March 23, 2009 Posted March 23, 2009 Right As I won't be here when they shut down and others will have turned them on long before I get here tomorrow - where can I go to see if they were shut down or not?? Run eventvwr (you can do this remotely - eventvwr \\machinename) and look for the eventlog entries. There should be one at 1830 this evening showing that the system was shutdown; the next entries will be when the machine restarts. Are you sure DNS is working OK for your network? If you do nslookup (without domain) at a prompt what happens? if you do ipconfig /all at a prompt, what does it show as the domain name?
silver Posted March 24, 2009 Author Posted March 24, 2009 Run eventvwr (you can do this remotely - eventvwr \\machinename) and look for the eventlog entries. There should be one at 1830 this evening showing that the system was shutdown; the next entries will be when the machine restarts. Are you sure DNS is working OK for your network? If you do nslookup (without domain) at a prompt what happens? if you do ipconfig /all at a prompt, what does it show as the domain name? If I do ipconfig/all the primary dns suffix shows as the the domain name, is this right? If I look at eventviewer, I get Application Error Records and System Error Records which don't seem to tell me what I want to know - am I in the right place and what should I be looking for?
srochford Posted March 24, 2009 Posted March 24, 2009 If I look at eventviewer, I get Application Error Records and System Error Records which don't seem to tell me what I want to know - am I in the right place and what should I be looking for? Look in System - you'll see records shown by date/time - look for those with a source of "Eventlog" and an Event of "6006" - this shows you when the machine last shut down.
ricki Posted March 24, 2009 Posted March 24, 2009 Hi You have one other option. You could do a start run, shutdown -i Browse for all the pcs that you want shutting down and complete the gui and click ok and it will get on with it. Its not automated but is easy to do if you are not sure. Just an idea. Richard
ricki Posted March 24, 2009 Posted March 24, 2009 HI You could also have a look at rmtSHUTDOWN Download which is a gui based tool.. Richard
silver Posted March 24, 2009 Author Posted March 24, 2009 There is no event to show the machine I am looking at was shutdown at 18.05pm. I can see the events where I shut down a machine earlier in the day when I was testing, but nothing after I left. Looking at another machine, I can see event 6006 at 18.32 which makes no sense at all. I suppose it might be that the machines weren't left on so just to be sure I will leave one on overnight and see what happens in the morning. I suspect it isn't working though
silver Posted March 24, 2009 Author Posted March 24, 2009 HI You could also have a look at rmtSHUTDOWN Download which is a gui based tool.. Richard Thanks but I really want to find out why what I have done doesnt work, when it should!!
Busybub Posted March 24, 2009 Posted March 24, 2009 I use the following in a .bat, one line for each computer, running as a scheduled task: start shutdown -s -t 300 -m \\computername -f I found that on one site it worked fine, on another I had to modify a group policy to allow admins to log on as a batch job as my predecessor had fiddled the default domain policy.
silver Posted March 26, 2009 Author Posted March 26, 2009 I managed to persuade the children NOT to shut down the machine and I have come in this morning to find an event log 6006 at 18.21. Does this make sense? The shutdown is scheduled for 18.05, could it take that long to get there?
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