question

RogerRoger-2394 avatar image
0 Votes"
RogerRoger-2394 asked TeemoTang-MSFT answered

Server Reboot

Hi All

i want to reboot one of my server daily at 5PM, the server should be rebooted even if any user is logged in or not. will the below task scheduler work for me. how do i specify if any user is logged in or not.

task schduler i have created a folder by name ServerReboot
Create Basic Task
Trigger Daily--Start 5PM Recur every 1 day
Action: start the program
Program/Script: shutdown -r Add Arguments: -t 60 (after 60 seconds it can reboot)

windows-serverwindows-server-2019windows-server-2016windows-server-2012windows-server-management
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LeonLaude avatar image
0 Votes"
LeonLaude answered LeonLaude edited

Hi @RogerRoger-2394,

The server will reboot even if a user is logged in, the scheduled task action should look as follows:

106275-shutdown-r.png


If the reply was helpful please don't forget to upvote and/or accept as answer, thank you!


Best regards,
Leon


shutdown-r.png (6.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TeemoTang-MSFT avatar image
0 Votes"
TeemoTang-MSFT answered

Yes, the task will run either you are logged in or not, I think your task scheduler steps are correct:

Detailed steps below:

  1. Run "Taskschd.msc" at the command prompt to open the Task Schedule.

  2. Click the Action menu, and then click Create Basic Task.

  3. Type a name for the task and an optional description, and then click Next.

  4. To select a schedule based on the calendar, click Daily then click Next; specify the schedule you want to use, and then click Next.

  5. To schedule a program to start automatically, click Start a program, and then click Next.

  6. Enter "at 17:00 shutdown -r -t 60" in the box and then click Next and finish.


If the Answer is helpful, please click "Accept Answer" and upvote it.
Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.