+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 20
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 ...
  1. #1
    silver's Avatar
    Join Date
    Dec 2008
    Location
    South
    Posts
    153
    Thank Post
    9
    Thanked 13 Times in 6 Posts
    Rep Power
    14

    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 01:50 PM.

  2. #2

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    Code:
    shutdown -s -m \\computername
    Or, of course, Shutdownertron can handle all this for you.

  3. #3

    Domino's Avatar
    Join Date
    Oct 2006
    Location
    Bromley
    Posts
    4,126
    Thank Post
    215
    Thanked 1,255 Times in 786 Posts
    Blog Entries
    4
    Rep Power
    505
    have you set the task to run as a domain admin?

  4. #4

    Join Date
    Jan 2008
    Location
    Kingston Upon Thames
    Posts
    102
    Thank Post
    11
    Thanked 22 Times in 20 Posts
    Rep Power
    17
    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

  5. #5
    silver's Avatar
    Join Date
    Dec 2008
    Location
    South
    Posts
    153
    Thank Post
    9
    Thanked 13 Times in 6 Posts
    Rep Power
    14
    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 01:13 PM.

  6. #6
    mrbios's Avatar
    Join Date
    Jun 2007
    Location
    Stroud, Gloucestershire
    Posts
    2,448
    Thank Post
    349
    Thanked 255 Times in 210 Posts
    Rep Power
    98
    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

  7. #7

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,154
    Thank Post
    114
    Thanked 527 Times in 450 Posts
    Blog Entries
    2
    Rep Power
    123
    Quote Originally Posted by silver View Post

    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 :-)

  8. #8
    silver's Avatar
    Join Date
    Dec 2008
    Location
    South
    Posts
    153
    Thank Post
    9
    Thanked 13 Times in 6 Posts
    Rep Power
    14
    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 01:31 PM.

  9. #9
    silver's Avatar
    Join Date
    Dec 2008
    Location
    South
    Posts
    153
    Thank Post
    9
    Thanked 13 Times in 6 Posts
    Rep Power
    14
    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??

  10. #10

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    Quote Originally Posted by silver View Post
    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.

  11. #11
    kennysarmy's Avatar
    Join Date
    Oct 2005
    Location
    UK
    Posts
    1,286
    Thank Post
    80
    Thanked 45 Times in 31 Posts
    Rep Power
    30
    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.

  12. #12

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,154
    Thank Post
    114
    Thanked 527 Times in 450 Posts
    Blog Entries
    2
    Rep Power
    123
    Quote Originally Posted by silver View Post
    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?

  13. #13
    silver's Avatar
    Join Date
    Dec 2008
    Location
    South
    Posts
    153
    Thank Post
    9
    Thanked 13 Times in 6 Posts
    Rep Power
    14
    Quote Originally Posted by srochford View Post
    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?

  14. #14

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,154
    Thank Post
    114
    Thanked 527 Times in 450 Posts
    Blog Entries
    2
    Rep Power
    123
    Quote Originally Posted by silver View Post
    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.

  15. #15
    ricki's Avatar
    Join Date
    Jul 2005
    Location
    uk
    Posts
    1,475
    Thank Post
    20
    Thanked 164 Times in 157 Posts
    Rep Power
    52
    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

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

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
  •