This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to Reboot machine at a scheduled time?

Hello,


We have an application launcher element that installs a new silent DLP solution on end workstations.  This solution requires a reboot at some point so we want to schedule the reboot of the clients machine when they are not here (at 11:59 PM).  We are able to easily create this task and in fact I tested in a CMD prompt on my workstation the code and it did reboot my machine that evening.

While some do power down or reboot, there are quite a few that just log off or lock their screens and turn off their monitor.  This is a fail safe to make sure the machine does reboot and the new software agent that is installed becomes fully functional.  Maybe there is another way to achive this but here is the issue we are having.

The line in our bat file successfully adds a one time reboot in Scheduled Tasks :

schtasks /create /sc once /tn "reboot" /tr "shutdown -r" /st 23:59

If I run Task Scheduler as administrator I can see this task on the workstation.  However the last run result says "The operation being requested was not performed because the user has not logged on to the network.  The specified service does not exist. (0x800704DD) Author: scriptlogicuser

 

Any ideas how to bypass that?

Parents
  • We have the same problem, users that never boot their computer, never want a delay, never give time to perform maintenance. We force the Windows update every Wednesday night and then use Desktop Authority to run a batch file at 1am which calls "shutdown /r" and forcibly reboots the PC's. This has been very successful....

     

    EXCEPT.

     

    I don't know what is up with Desktop Authority scheduler, but even when the rule is scheduled to run at 1am and not run later, sometimes it pops up in the middle of the day. So we added in some logic in the batch file to track with log files what is happening and try to prevent it from running after 3am but also so that if it does pop up the user has a chance to abort it. The batch file we run is:

    SET Hour=%Time:~0,2%
    if %Hour% LEQ 3 (
      echo shutdown attempted at %TIME% %DATE% >>c:\shutdownlog.log
      Shutdown /r /t 600 /c "Your computer is being restarted by the tech department for weekly maintenance. To cancel shutdown press any key."
      echo Your computer will reboot in 10 minute press any key to cancel.
      pause
      SHUTDOWN /A
    ) else (
      echo Shutdown of %COMPUTERNAME% attempted at %DATE% at %TIME%, outside of window...aborted >>\\tech\c$\ShutdownFailedLog.log
    )
    Exit

Reply
  • We have the same problem, users that never boot their computer, never want a delay, never give time to perform maintenance. We force the Windows update every Wednesday night and then use Desktop Authority to run a batch file at 1am which calls "shutdown /r" and forcibly reboots the PC's. This has been very successful....

     

    EXCEPT.

     

    I don't know what is up with Desktop Authority scheduler, but even when the rule is scheduled to run at 1am and not run later, sometimes it pops up in the middle of the day. So we added in some logic in the batch file to track with log files what is happening and try to prevent it from running after 3am but also so that if it does pop up the user has a chance to abort it. The batch file we run is:

    SET Hour=%Time:~0,2%
    if %Hour% LEQ 3 (
      echo shutdown attempted at %TIME% %DATE% >>c:\shutdownlog.log
      Shutdown /r /t 600 /c "Your computer is being restarted by the tech department for weekly maintenance. To cancel shutdown press any key."
      echo Your computer will reboot in 10 minute press any key to cancel.
      pause
      SHUTDOWN /A
    ) else (
      echo Shutdown of %COMPUTERNAME% attempted at %DATE% at %TIME%, outside of window...aborted >>\\tech\c$\ShutdownFailedLog.log
    )
    Exit

Children
No Data