RE: Reboot Script for Group Policy?



Umesh,
Thanks so much for the code....I really appreciate it. Just a couple of
quick questions since I'm not much of a VB guy!

Do you know what the format of the text file needs to be? Comma-delimmited?
For example, should it be:

computer1, 10:45
computer2, 9:30
computer3, 13:00
etc....

Also, do you know where in the code to change how often the program checks
the text file? Could find it.

Thanks again for all your help!!!

P.S. I'm a big fan of sleep myself!! haha

"Umesh Thakur" wrote:

> John,
>
> I have a script that I use to reboot remote computers. Fro your scenario, I
> would recommend a script that will run on your own computer (or any other
> that you want) and it perform following operations:
> - There will be text/excel file containing names and reboot times of
> respective machines.
> - This script will run as a background program, and keep checking for reboot
> schedule from above mentioned file, on interval of say 1 second (or whatever
> interval you want).
> - If an scheduled reboot is found, it will reboot the machine, and inform
> you (with a dialog box OR log an entry in event viewer)
>
> However, there is one requirement for this script: Script must run under
> user account that has admin rights on respective computers that will be
> rebooted. OR, you need to specify admin user acct info in text/excel file
> mentioned above, to reboot those machines using those accounts.
>
> Below is script that I uses, to reboot machines remotely:
> If you are comfortable enough to tailor it to suit your needs, its great!
> else, you can revert back to me.
> ---------------------------------------------------------
> 'Script to REBOOT a machine remotely...
> 'USAGE: RebootRemoteComputer <CompName/IP Address> <Username> [Password]
> [Domain] "
> 'by Umesh Thakur (mailto:umesh.thakur@xxxxxxxxx)
> set wsa=Wscript.Arguments
> if wsa.count < 2 then
> wscript.echo "USAGE: RebootRemoteComputer <CompName/IP Address> <Username>
> [Password] [Domain]"
> wscript.Quit (0)
> end if
> strComputer = wsa(0)
> strUser=wsa(1)
> if wsa.count>=3 then
> if wsa(2)<> "*" then
> strPassword = wsa(2)
> else
> Set objPassword = CreateObject("ScriptPW.Password")
> Wscript.StdOut.Write "Please enter your password:"
> strPassword = objPassword.GetPassword()
> end if
> else
> Set objPassword = CreateObject("ScriptPW.Password")
> Wscript.StdOut.Write "Please enter your password:"
> strPassword = objPassword.GetPassword()
> end if
> if wsa.count >=4 then
> strDomain=wsa(3)
> else
> strDomain=strComputer
> end if
> wscript.echo
> wscript.echo "Connecting to computer:" & strComputer & " using Username: " &
> strUser & "..."
> Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
> if wsa.count>=4 then 'domain is specified
> Set objSWbemServices = objSWbemLocator.ConnectServer(strComputer,
> "root\cimv2", strUser, strPassword, "MS_409", "ntlmdomain:" + strDomain)
> else
> Set objSWbemServices = objSWbemLocator.ConnectServer(strComputer,
> "root\cimv2", strUser, strPassword, "MS_409")
> end if
>
> Set colOperatingSystems = objSWbemServices.ExecQuery("Select * from
> Win32_OperatingSystem")
> wscript.echo "Rebooting..."
> For Each objOperatingSystem in colOperatingSystems
> objOperatingSystem.Reboot()
> Next
> '---------------------------------------------------------------
>
> Umesh Thakur
> --
> When you are unable to keep your eyes open, do go and sleep for few hours!!!
>
>
> "RTResolutions_John" wrote:
>
> > Does anyone know of a script that can be deployed via group policy that will
> > reboot applicable machines at a specified time (ie Monday - Friday at 2am).
> > I've found several that will do it immediately when the script is run but
> > none that will do it at a certain time.
> >
> > Other ways I've come across (ie copying the shutdown.exe app on remote
> > machines and setting up a task to run) are impratical for a large org. We
> > are a pure Windows 2K environment.
> >
> > Any help is greatly appreciated!!
.



Relevant Pages

  • RE: Reboot Script for Group Policy?
    ... For your convenience, I have modified the script I sent you earlier, In this ... Machines Names/IP and time should be separated by ... 'Script to REBOOT a machine remotely... ... make sure that all computers have reboot times mentioned." ...
    (microsoft.public.windows.server.scripting)
  • RE: Reboot Script for Group Policy?
    ... Thanks for the reply and modification you made to the script you provided. ... Machines Names/IP and time should be separated by ... > 'Script to REBOOT a machine remotely... ... >>> I have a script that I use to reboot remote computers. ...
    (microsoft.public.windows.server.scripting)
  • RE: Reboot Script for Group Policy?
    ... I have a script that I use to reboot remote computers. ... to reboot those machines using those accounts. ...
    (microsoft.public.windows.server.scripting)
  • reboot clients
    ... I am noticing many people do not reboot their machines. ... a way to run a script every night to reboot all machines. ...
    (microsoft.public.windows.server.scripting)
  • Re: Automating password change
    ... All the machines are set up differently from each other ... > use telnet, others I can rlogin or remsh, and still others I can ssh. ... it would not be practical to try to write a complex script ... > to write a simple script to wrap around passwd that would run on each ...
    (comp.unix.solaris)