Monday, May 04, 2020

Automating Reboots with Task Scheduler

How to automate a reboot or shutdown with task scheduler. To do this you will have to be a user with admin permissions.  You can view the video here

1. Open Task Scheduler



2. Create a new task



3. Fill out the settings in the general tab.  How you want to configure the command and the user account running it.  In this case, I am using a local administrator account, it will run if the user is logged in or not, run with highest privileges, and is configured for server 2019


4.  Create and configure a new trigger


For our new tigger we are setting it to be run on a daily schedule, 5 am every day.  Here you can also disable the task or have it expire after a specific date.


5. Once triggers are set, we can put the code in for setting up the reboot in the actions tab.


Here is where the code goes for executing the reboot

%SystemRoot%\system32\shutdown.exe -r -f -t 1

The task above has set a reboot of the system in one second.  You can read below for other options that can be configured.

Shutdown
%SystemRoot%\system32\shutdown.exe -s -f -t 60 (Shutdown the system in 60 seconds)

Reboot
%SystemRoot%\system32\shutdown.exe -r -f -t 60 (Reboot the system in 60 seconds)

Here is a description of the parameters used above:

-s : The shutdown option.  This will turn the computer off.

-r : The reboot option.  This will reboot the system (turn it off and on again)

-f : forces all applications and services to close and/or stop.

-t : timeout before executing the shutdown or reboot (in seconds).  The default is 20 seconds, but can be changed by adding a number right after it, separated by a space: for example, -t 60 for 60 seconds.

6. Conditions


Setup any additional conditions you want the to configure, such as only running if there is a network connection, if the system has been idle, etc.

7. Settings

How to fix CURL call imporitng an RSS feed on a site blocking CURL calls

There is a 3rd party service provider that my organization uses called bibliocommons.  They have these nice book carousels.  However the car...