Windows Thread, OK, so I know I am stupid..what have I done wrong now?? in Technical; I am trying to shut down all the computers at 6.30pm and I don't know if I have done it ...
-
23rd March 2009, 01:59 PM #1 OK, so I know I am stupid..what have I done wrong now??
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??
Last edited by silver; 23rd March 2009 at 02:50 PM.
-
-
IDG Tech News
-
23rd March 2009, 02:01 PM #2 Code:
shutdown -s -m \\computername
Or, of course, Shutdownertron can handle all this for you.
-
-
23rd March 2009, 02:01 PM #3 have you set the task to run as a domain admin?
-
-
23rd March 2009, 02:06 PM #4 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
-
-
23rd March 2009, 02:09 PM #5 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?
Last edited by silver; 23rd March 2009 at 02:13 PM.
-
-
23rd March 2009, 02:09 PM #6 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
-
-
23rd March 2009, 02:27 PM #7 
Originally Posted by
silver
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:
Code:
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 :-)
-
-
23rd March 2009, 02:28 PM #8 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
Last edited by silver; 23rd March 2009 at 02:31 PM.
-
-
23rd March 2009, 02:52 PM #9 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??
-
-
23rd March 2009, 03:02 PM #10 
Originally Posted by
silver
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.
-
-
23rd March 2009, 03:54 PM #11 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.
-
-
23rd March 2009, 04:21 PM #12 Have you tried renaming the .BAT to .CMD instead?
-
-
23rd March 2009, 06:10 PM #13 
Originally Posted by
silver
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 <machinename> (without domain) at a prompt what happens? if you do ipconfig /all at a prompt, what does it show as the domain name?
-
-
24th March 2009, 12:03 PM #14 
Originally Posted by
srochford
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 <machinename> (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?
-
-
24th March 2009, 12:19 PM #15 
Originally Posted by
silver
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.
-
SHARE:
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules