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?

  • 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

  • note this runs as a "application launcher" element in computer configuration. Doing so will automatically allow it to run with the admin account which has full rights even without a user logged in.
  • Well I'm trying to add the /RU flag to insert this reboot scheduled task as "SYSTEM" account.  I'm hoping that this works instead.

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

     

    YES there IS something wrong with the scheduler!  We had a weekly script set to run under the Computer side of DA to defrag hard drives.  I (and others) have sometimes noticed this pop up that Desktop Authority was going to defrag the computer.  Obviously we hit abort in the middle of the day.  I just deleted this task because we have been getting SSD drives out to more and more computers through new machines or old machine upgrades.  Defrag isn't going to do any good on an SSD.

     

    I wonder WHY the scheduler doesn't work right?  It seems random too.  Let me know if you ever figure that one out.

  • I am not sure if I am missing anything but I am wondering why you do not use the Inactivity object to Restart the machines? One of the actions on the list is Restart and you can select the times on the built-in inactivity schedule to monitor for inactivity during those specific hours that you mentioned in your posting. You can even pop a message to the user before restarting the box. In addition, you can also use one of the shutdown options in case there is no logged on user session but you want to ensure the machine gets cycled down. I sincerely hope that this helps and that I understand your issue properly.
  • See that is why I post here in the community. Some great suggestions from other users! Quest-Mac, you are absolutely right. I should probably use the Inactivity monitor for this. We do use it to log people off after hours (Except for IT and Exec Mgmt that may need to logmein or run certain processes overnight).

    I didn't even think to look into that to not just log off, but restart instead. We would like to have PC's in a fresh state each morning and perhaps a restart would help achieve that.

    Thank you so much for your time.!
  • We tested the inactivity timer several versions back and found it unreliable, but I haven't tried it recently. I will give it another try! It doesn't have any ability to find out what systems did not get rebooted but I think we can create a simple on-startup logfile that will give us that info.
  • as I feared, the inactivity timer in 9.3 is not reliable. Tried it on 2 different systems, in various configurations (logged out, locked, logged in, warning turned on, warning turned off) it never successfully fired for us at all, at least on Windows 10. We will see if its any better in version 10 this summer when we upgrade.
  • We've been using the Inactivity element for years now. We set it at 2am every day if the PC has been inactive for 15 minutes (just in case somebody is burning the midnight oil). Has worked wonderfully for us.
  • Agreed with butlerm, we've had a LOT of trouble with the reliability of the inactivity timer, half the time it won't logout or reboot computers as expected. We created a similar script to force a reboot at a specific time, with a way to opt out if someone is actually still working at that time. We haven't had problems with the element firing at odd hours; we discovered that can be a problem if we check "if the computer is unavailable at specified time, run as soon as available".