Home All Groups Group Topic Archive Search About

Batch Scheduled Shutdown of Workstations.

Author
5 Apr 2007 8:56 AM
Steve Audus, Chaucer BEC, Sheffield UK
I have scheduled the shutdown of all our schools XP workstations.
using the shutdown command.

shutdown /s /m \\%computer_name% /t 1 /c "Shuting Down" /f

It works great if the workstation is on, it shuts it down very quickley and
moves onto the next machine.

But if a workstation is already switched off, then we get the error
"The network path no found"

But this takes over a minute to return this error, dramaticly slowing to
whole process. Last night the batch process ran for 4 hours, and did not
complete the whole list of 400 workstations.

Any advise?

Thanks
Steve

Author
5 Apr 2007 9:39 AM
steve
"Steve Audus, Chaucer BEC, Sheffield UK"
<SteveAudusChaucerBECSheffiel***@discussions.microsoft.com> wrote in message
Show quoteHide quote
news:C3E06778-6497-45CE-A2E3-B13E9D3218F8@microsoft.com...
>I have scheduled the shutdown of all our schools XP workstations.
> using the shutdown command.
>
> shutdown /s /m \\%computer_name% /t 1 /c "Shuting Down" /f
>
> It works great if the workstation is on, it shuts it down very quickley
> and
> moves onto the next machine.
>
> But if a workstation is already switched off, then we get the error
> "The network path no found"
>
> But this takes over a minute to return this error, dramaticly slowing to
> whole process. Last night the batch process ran for 4 hours, and did not
> complete the whole list of 400 workstations.
>
> Any advise?
>
> Thanks
> Steve

I have my machines write their machine name in a daily text file when they
boot up, and in another when they shut down. This way I can iterate through
both lists at the end of the day to work out which machines are still on and
need a remote shutdown.

steve
Are all your drivers up to date? click for free checkup

Author
5 Apr 2007 9:52 AM
Steve Audus, Chaucer BEC, Sheffield UK
Very interesting, is there any chance of showing me an example of the
workstation scripting you use to do this?

Thanks

Steve
Author
5 Apr 2007 10:11 AM
Pegasus (MVP)
<Steve Audus>; <Chaucer BEC>; "Sheffield UK"
<SteveAudusChaucerBECSheffiel***@discussions.microsoft.com> wrote in message
Show quoteHide quote
news:C3E06778-6497-45CE-A2E3-B13E9D3218F8@microsoft.com...
> I have scheduled the shutdown of all our schools XP workstations.
> using the shutdown command.
>
> shutdown /s /m \\%computer_name% /t 1 /c "Shuting Down" /f
>
> It works great if the workstation is on, it shuts it down very quickley
and
> moves onto the next machine.
>
> But if a workstation is already switched off, then we get the error
> "The network path no found"
>
> But this takes over a minute to return this error, dramaticly slowing to
> whole process. Last night the batch process ran for 4 hours, and did not
> complete the whole list of 400 workstations.
>
> Any advise?
>
> Thanks
> Steve

You could do it like so:
1. Create a list of all IP addresses. This works only if you
    have fixed addresses. It does not work if you use DHCP.
2. Run this batch file:

@echo off
for /F %%a in (c:\IPAddresses.txt) do (
  echo Processing %%a
  ping %%a -n 1 | find /i "bytes=" && shutdown /s /m \\%%a /t 1 /c "Shuting
Down" /f
)

Note that the "ping" line is a long line. It ends on "/f".
Note also that you won't win the popularity contest with
your extremely short warning time. Someone might be
working late . . . I would make it 10 or 15 minutes.
Author
5 Apr 2007 2:18 PM
Steve Audus, Chaucer BEC, Sheffield UK
This looks the best method,
but isn't it possible to ping the DNS name of workstations
as we use DHCP?

Thanks for the help

Steve
Author
5 Apr 2007 2:24 PM
Pegasus (MVP)
<Steve Audus>; <Chaucer BEC>; "Sheffield UK"
<SteveAudusChaucerBECSheffiel***@discussions.microsoft.com> wrote in message
news:FD318402-9727-4B4A-95C3-CD3B790E928D@microsoft.com...
> This looks the best method,
> but isn't it possible to ping the DNS name of workstations
> as we use DHCP?
>
> Thanks for the help
>
> Steve

Yes, you can ping NetBIOS names but it takes much
longer to detect a PC that is turned off than if you
ping it by IP addresses. You should consider Heb Martin's
Task Scheduler solution - it wouild shut down all PCs
at the same time.
Author
5 Apr 2007 2:38 PM
Herb Martin
Show quote Hide quote
"Pegasus (MVP)" <I.***@fly.com> wrote in message
news:uCNSi44dHHA.5044@TK2MSFTNGP05.phx.gbl...
>
> <Steve Audus>; <Chaucer BEC>; "Sheffield UK"
> <SteveAudusChaucerBECSheffiel***@discussions.microsoft.com> wrote in
> message
> news:FD318402-9727-4B4A-95C3-CD3B790E928D@microsoft.com...
>> This looks the best method,
>> but isn't it possible to ping the DNS name of workstations
>> as we use DHCP?
>>
>> Thanks for the help
>>
>> Steve
>
> Yes, you can ping NetBIOS names but it takes much
> longer to detect a PC that is turned off than if you
> ping it by IP addresses. You should consider Heb Martin's
> Task Scheduler solution - it wouild shut down all PCs
> at the same time.

Or maybe both of these.  Do it from the scheduler and also
from the Ping-Batch so you get it either way.

BTW, why are you shutting down computers?

(We never do when it is at all avoidable.  <grin>)

Machines would stay on for years were it not for reboots after security
patches etc.  As it is, they stay on for weeks or months whenever we
don't have those patches.


--
Herb Martin, MCSE, MVP
http://www.LearnQuick.Com
(phone on web site)
Author
5 Apr 2007 2:18 PM
Steve Audus, Chaucer BEC, Sheffield UK

Author
5 Apr 2007 10:22 AM
Phill
Why not ping the workstation first (single ping) within the the script  if
response ok then shutdown.
Or set the schedule on all of the workstations that run a central batch file
that has the shutdown script.


"Steve Audus, Chaucer BEC, Sheffield UK"
<SteveAudusChaucerBECSheffiel***@discussions.microsoft.com> wrote in message
Show quoteHide quote
news:C3E06778-6497-45CE-A2E3-B13E9D3218F8@microsoft.com...
>I have scheduled the shutdown of all our schools XP workstations.
> using the shutdown command.
>
> shutdown /s /m \\%computer_name% /t 1 /c "Shuting Down" /f
>
> It works great if the workstation is on, it shuts it down very quickley
> and
> moves onto the next machine.
>
> But if a workstation is already switched off, then we get the error
> "The network path no found"
>
> But this takes over a minute to return this error, dramaticly slowing to
> whole process. Last night the batch process ran for 4 hours, and did not
> complete the whole list of 400 workstations.
>
> Any advise?
>
> Thanks
> Steve
Author
5 Apr 2007 11:34 AM
Herb Martin
"Phill" <p***@sedd.gotadsl.co.uk> wrote in message
news:e7SdnbF5wtdcUInbnZ2dnUVZ8qqlnZ2d@pipex.net...
> Why not ping the workstation first (single ping) within the the script  if
> response ok then shutdown.
> Or set the schedule on all of the workstations that run a central batch
> file that has the shutdown script.

Using the scheduler on each workstation seems to be the safest,
most reliable solution.
Author
16 Apr 2007 7:00 AM
Steve Audus, Chaucer BEC, Sheffield UK
Thank you for all your suggestions, a great help.

I am now using both methods very succesfully.

The reason for shutting down our workstations is simple, to save energy.

Thank you

Steve
Author
21 Apr 2007 12:54 AM
Steven
Why not "start" each of these tasks so they run asynchronously ??? i.e., all the shutdowns happen simultaneously ...

Shutdown.cmd

start shutdown /f /s /m \\junk0.domain.com ...
start shutdown /f /s /m \\junk1.domain.com ...
start shutdown /f /s /m \\junk2.domain.com ...

Will run within a minute or so

EggHeadCafe.com - .NET Developer Portal of Choice
http://www.eggheadcafe.com
Author
23 Apr 2007 1:50 PM
Tom Willett
To whom are you replying, and about what?  Why did you change the subject
and start a new thread.
Oh, I see...an Eggheader.

<Steven> wrote in message news:2007420205451nospam@lifeoncottonwood.com...
| Why not "start" each of these tasks so they run asynchronously ??? i.e.,
all the shutdowns happen simultaneously ...
Show quoteHide quote
|
| Shutdown.cmd
|
| start shutdown /f /s /m \\junk0.domain.com ...
| start shutdown /f /s /m \\junk1.domain.com ...
| start shutdown /f /s /m \\junk2.domain.com ...
|
| Will run within a minute or so
|
| EggHeadCafe.com - .NET Developer Portal of Choice
| http://www.eggheadcafe.com

Bookmark and Share