Windows OS Hub
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows 10
    • Windows Server 2025
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
    • Proxmox
  • PowerShell
  • Linux

 Windows OS Hub / Windows 11 / Configure Windows to Auto Restart/Shutdown with Task Scheduler

August 27, 2025

Configure Windows to Auto Restart/Shutdown with Task Scheduler

The simplest way to schedule regular reboots or shutdowns of a Windows computer (or server) is to create a job in Task Scheduler.

Contents:
  • Creating an Automatic Reboot (Shutdown) Task in Windows Task Scheduler
  • Use Group Policy (GPO) to Schedule an Automatic Windows Shutdown or Reboot

Using a PowerShell script, you can create a delayed reboot task to schedule a computer reboot at a specific time.

[datetime]$RestartTime = '15:10'
[datetime]$CurrentTime = Get-Date
[int]$WaitSeconds = ( $RestartTime - $CurrentTime ).TotalSeconds
shutdown -r -t $WaitSeconds

Reboot Windows computer at a specific date and time

Scheduled reboot tasks are used more often than one-time tasks. For example, you need to create a scheduled task that automatically reboots a Windows host every Monday at 3:00 A.M.

Creating an Automatic Reboot (Shutdown) Task in Windows Task Scheduler

Open the Task Scheduler console (taskschd.msc) and run the task creation wizard: Action -> Create Basic Task.

Create new scheduled task

Set the task name: RebootMonday

Configure a task schedule. In our example, this is a weekly task that runs every Monday.

Configure scheduling in task settings

Select Start a program. We will reboot the host using the built-in shutdown.exe command with the following parameters:

Program: %SYSTEMROOT%\System32\shutdown.exe

Add arguments (optional): /r /f /t 120 /d p:0:0 /c "Auto-reboot on Mondays. To cancel, run: shutdown.exe /a"

Restart Windows using scheduled task

  • /r — reboot
  • /f – force close all running apps
  • /t 120 – a 120-second timeout before the system is rebooted
  • /d p:0:0 — add the reboot reason to Event Viewer: Other (planned)
  • /c – display this informational message in active user sessions before rebooting the host.

In order to run a task automatically, regardless of whether there are active user sessions on the computer:

  1. Open the task properties in the Task Scheduler snap-in
  2. Select the option Run whether user is logged or not
  3. Click the Change User or Group button and type SYSTEM Run task as SYSTEM
  4. Now the task will be run on behalf of NT AUTHORITY\SYSTEM.
  5. Make sure the task is enabled.

This host will now automatically reboot at the scheduled time and display a notification before the restart.

Auto reboot notification

To forcefully wake up and reboot the computer, enable the Wake the computer to run this task option in the task’s properties on the Actions tab.

Wake the computer to run this task

Wake-on-LAN can also be used to remotely wake up a Windows device. 

This PowerShell script can be used to easily create a scheduled task with a reboot command:

$taskName = "WeeklyAutoReboot"
$taskDescription = "Automatically reboots the server every Monday at 04:00 AM"
$action = New-ScheduledTaskAction -Execute "shutdown.exe" -Argument "/r /f /t 120 /d p:0:0 /c `"Auto-reboot on Mondays. To cancel, run: shutdown.exe /a"
$trigger = New-ScheduledTaskTrigger -Weekly -DaysOfWeek Monday -At 4:00am
$principal = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest
Register-ScheduledTask -TaskName $taskName -Action $action -Trigger $trigger -Principal $principal

Use Group Policy (GPO) to Schedule an Automatic Windows Shutdown or Reboot

If you want to schedule the auto shutdown or restart task on multiple computers in an Active Directory domain, you can create a scheduled task using Group Policy.

  1. Open the domain Group Policy Management console (gpmc.msc) and create a new Group Policy Object (GPO). Link the GPO to the organizational unit (OU) that contains the computers that need to be rebooted or shut down on a schedule. Create GPO to schedule auto restart
  2. Edit the new GPO and navigate to Computer Configuration -> Preferences -> Control Panel Settings -> Scheduled Tasks;
  3. Create a new task: New -> Scheduled task (At least Windows 7);
  4. Set the task name and configure it to run as the SYSTEM account. Configure reboot task in Group Policy
  5. Configure a task schedule on the Triggers tab. Configure time based criteria to auto restart
  6. On the Actions tab, add the shutdown.exe command with the described options. shutdown.exe command with options for delayed reboot
  7. Save the changes.
  8. Update the GPO settings on the target client and verify that the scheduled Windows reboot task appears in Task Scheduler.
To exclude critical computers from the reboot policy, add them to the GPO exceptions via Security Filters.

If you need to bind the automatic reboot/shutdown task to the completion of another task (for example, you want to restart the host after the backup task is successfully completed), see the example in the post “How to Run a Scheduled Task After Another Task Completes“.

0 comment
0
Facebook Twitter Google + Pinterest
Group PoliciesPowerShellQuestions and AnswersWindows 10Windows 11Windows Server 2022Windows Server 2025
previous post
Proxmox: Share a Host Directory with VMs via VirtioFS
next post
DPI Scaling and Font Size in RDP (RDS) Session

Related Reading

Configuring RemoteApps Hosted on Windows 10/11 (without Windows...

January 25, 2025

Disable BitLocker Automatic Drive Encryption in Windows 11

October 16, 2024

Get Started with Docker on Windows (WSL2) without...

September 4, 2024

Disable and Completely Remove Widgets from Taskbar in...

September 26, 2024

Adding Multiple Alternate DNS Names for a Windows...

September 3, 2024

Bridging Multiple Network Interfaces on Windows

November 21, 2024

How to Cast/Mirror Android Screen to Windows PC

September 11, 2024

Fix: Windows Update Tab (Button) is Missing from...

December 16, 2024

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Proxmox: Share a Host Directory with VMs via VirtioFS

    August 18, 2025
  • How to Find AD Users with Blank Passwords (Password-Not-Required)

    July 24, 2025
  • Run Elevated Commands with Sudo on Windows 11

    July 16, 2025
  • Find a Process Causing High Disk Usage on Windows

    July 15, 2025
  • Fix: Microsoft Defender Not Updating Automatically in Windows

    July 8, 2025
  • Create a Windows Server VM on Proxmox (Step-by-Step)

    July 7, 2025
  • How to Detect Which User Installed or Removed a Program on Windows

    June 23, 2025
  • Encrypt Any Client-Server App Traffic on Windows with Stunnel

    June 12, 2025
  • Failed to Open the Group Policy Object on a Computer

    June 2, 2025
  • Remote Desktop Printing with RD Easy Print Redirection

    June 2, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Add or Remove Pinned Folders to Quick Access with PowerShell and GPO
  • Mapping SharePoint Online Library as Network Drive in Windows
  • Prevent Server Manager from Starting at Logon on Windows Server
  • Configure NTP Time Source for Active Directory Domain
  • Configure File and Folder Access Auditing on Windows (GPO)
  • Unlocking Active Directory User Accounts
  • Exclude a Specific User or Computer from Group Policy
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top