Re: Script to reboot group of PCs

From: Mike [MSFT] (mikeva_at_online.microsoft.com)
Date: 10/14/04


Date: Wed, 13 Oct 2004 17:31:59 -0700

TRY: Shutdown /?

/m = specify machine to shutdown
/r = reboot
/t = time to wait
/f = force shutdown (open unsaved data will be lost)

-- 
Thanks,
Mike
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at 
http://www.microsoft.com/info/cpyright.htm
Please do not send e-mail directly to this alias.
This alias is for newsgroup purposes only.
"Douglas McIver" <douglas@nospam.com> wrote in message 
news:%23ccc9NYsEHA.2808@TK2MSFTNGP14.phx.gbl...
> What do all of those switches mean?
> "Mike [MSFT]" <mikeva@online.microsoft.com> wrote in message
> news:%236JlhmUsEHA.2516@TK2MSFTNGP11.phx.gbl...
>> You could also do it with a single command line and use shutdown.exe that
> in
>> already in the OS.
>>
>> for /f %x in (machines.txt) do shutdown /m \\%x /r /t 0 /f
>>
>> Where machines.txt is a list of machine names or IP's you want to reboot.
>>
>> -- 
>>
>> Thanks,
>> Mike
>>
>> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>> Use of any included script samples are subject to the terms specified at
>> http://www.microsoft.com/info/cpyright.htm
>>
>> Please do not send e-mail directly to this alias.
>> This alias is for newsgroup purposes only.
>>
>>
>> "Douglas McIver" <douglas@nospam.com> wrote in message
>> news:OMN9KuSsEHA.832@TK2MSFTNGP10.phx.gbl...
>> > Thank you very much, I am going to try the PS Tools.
>> >
>> > Thanks!
>> > Douglas
>> > "Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
>> > news:%234KOGoSsEHA.904@TK2MSFTNGP11.phx.gbl...
>> >> Doug wrote:
>> >>
>> >> > Does anyone know of a simple vbs script that I can use to reboot a
> list
>> > of
>> >> > PCs?  I found the one at the bottom of this page, but it only 
>> >> > reboots
>> > that
>> >> > one PC.  I would like to be able to put in multiple PC names.
>> >> >
>> >> > Thanks,
>> >> > Douglas
>> >> >
>> >> > strComputer = "PCNAME"
>> >> > Set objWMIService = GetObject("winmgmts:" _
>> >> >     & "{impersonationLevel=impersonate,(Shutdown)}!\\" & _
>> >> >         strComputer & "\root\cimv2")
>> >> > Set colOperatingSystems = objWMIService.ExecQuery _
>> >> >     ("Select * from Win32_OperatingSystem")
>> >> > For Each objOperatingSystem in colOperatingSystems
>> >> >     ObjOperatingSystem.Reboot()
>> >> >
>> >> >
>> >> Hi
>> >>
>> >> PsShutdown.exe in the free PsTools suite can take a file with computer
>> >> names as input:
>> >>
>> >> http://www.sysinternals.com/ntw2k/freeware/pstools.shtml
>> >>
>> >>
>> >> BeyondExec does also have the ability to shutdown groups of computers
>> >> (multiple computer support is handled by multi-threaded routines
>> >> speeding up the issuing of jobs):
>> >>
>> >> http://www.beyondlogic.org/consulting/remoteprocess/BeyondExec.htm
>> >>
>> >>
>> >>
>> >> -- 
>> >> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
>> >> Administration scripting examples and an ONLINE version of
>> >> the 1328 page Scripting Guide:
>> >> http://www.microsoft.com/technet/scriptcenter/default.mspx
>> >
>> >
>>
>>
>
> 


Relevant Pages

  • Re: Finetuning: Remote Shutdown with WMI, some errors occur.
    ... Allows shutdown, poweroff, or reboot of multiple remote systems. ... - generic unhandled script compile or runtime error; ... "Specify 1 and only one shutdown action" ... Dim erNumber, erDesc ...
    (microsoft.public.windows.server.scripting)
  • Re: Help needed with a js command
    ... The original script allowed to shutdown any computer in the ... computer, and I just need to reboot one computer, anyway. ... Const EWX_SHUTDOWN = 1 ...
    (microsoft.public.scripting.jscript)
  • Re: shutdown/reboot suggestion
    ... I have such a script, I put it in /bin/require_hostname and symlinked ... shutdown, halt, reboot, fastboot, and fasthalt to this script: ... have inadvertently shutdown or rebooted the wrong machine. ... These are all distinct from my term window color scheme for my local host. ...
    (freebsd-questions)
  • Re: script to mail@localhost when system reboots
    ... I have to create a script which sends a mail everyttime the system ... echo "Shutdown" ... echo "Single User" ... echo "Reboot" ...
    (comp.os.linux.misc)
  • Re: script to mail@localhost when system reboots
    ... I have to create a script which sends a mail everyttime the system ... echo "Shutdown" ... echo "Single User" ... echo "Reboot" ...
    (comp.os.linux.misc)