New England Security User Group

 View Only
  • 1.  Restart Computer after Period of Inactivity

    Posted Jun 19, 2014 09:16 AM

    We are looking for a way to restart a computer after a period of inactivity.  Does anyone know of a way to accomplish this.  I have checked google and the connect forums but i have not found anything.  Any help would be appreciated.  We are using 7.5 HF4



  • 2.  RE: Restart Computer after Period of Inactivity

    Broadcom Employee
    Posted Jun 19, 2014 11:50 AM

    Hi,

    maybe "Automation Policy" will resolve this case

    For example:

    1. Create "Reboot PC" task
    2. Specify SQL Query to determine inactive managed computers
    3. Create "Automation Policy":

    AutomationReboot1.jpg

    • Set Scheduled "Daily" (or another appropriate schedule)
    • Specify there SQL Query
    • Specify there "Reboot PC" task
    • Edit input parameter and set "Guid" which will be included in "Reboot PC" task

    AutomationReboot2.jpg

     

    Thanks,

    IP.



  • 3.  RE: Restart Computer after Period of Inactivity

    Posted Jun 19, 2014 12:08 PM

    What do you mean by "a period of inactivity"?  As in, not communicating to the NS or as in a user is logged in but not using the computer (typing or using the mouse).  You may get better suggestions if you share your purpose for this task.  For instance, if this is related to patching, you can setup separate install and reboot schedules.



  • 4.  RE: Restart Computer after Period of Inactivity

    Posted Jun 19, 2014 12:46 PM

    That is a good start.  I am looking for something like if the computer has been idle or not used for 4 hours reboot.  Our computers in our environment do not reboot very often and we have applied some patches and need to reboot them.  In a hospital that needs to keep running 24/7, rebooting a computer my be bad for patient care.



  • 5.  RE: Restart Computer after Period of Inactivity

    Posted Jun 19, 2014 03:38 PM

    I believe I understand.  So reboot can happen at any time but only after computer is idle for an hour for instance.

    The reboot options within ITMS Patch Management allow you to reboot right after a patching cycle competes or at a certain time which doesn't sound like it meets your needs.  Also, the Altiris server doesn't know when a machine is idle so you won't be able to do this with a task without combining some client-side logic.

    If it were me, I would create a custom script that checks if a reboot is pending and reboots the machine.  Then instead of running that as a Altiris task or policy, run that script as a scheduled task using Windows scheduler.  Scheduled tasks have lots of options to use as triggers, one of which is how long a system has been idle.  So you could schedule the reboot task to run every 30 minutes but only when the system has been idle for an hour.  The task won't do anything unless a reboot is required.

    If the patches you are installing are for custom software that doesn't set the system reboot required registry flag, you could use a custom registry key as a reboot flag and make sure your script flips the flag when it reboots.  Then your custom packages could set the flag whenever a reboot is needed.

    SchTasks.exe is a command line tool that can be used to schedule a task or there are VBS objects and PowerShell methods as well.  You may find it easiest to setup the task the way you want then export it and use a command line to import the configured task.

    Info on determining if reboot is required including a PowerShell method:

    http://blogs.technet.com/b/heyscriptingguy/archive/2013/06/10/determine-pending-reboot-status-powershell-style-part-1.aspx