rss logo

How to Schedule Automatic Computer Shutdown with Group Policy

Microsoft logo

In corporate environments, it's all too common for users to forget to shut down their computers before leaving the office. To address this—and in the interest of saving our planet (and perhaps even a few dolphins)—you can use a Group Policy Object (GPO) to automatically shut down computers at a scheduled time.

Create a Group Policy Object

  • On a Domain Controller, open the Active Directory Users and Computers management console:
Run dialog showing the 'dsa.msc' command to open Active Directory Users and Computers.
  • Move the users for whom you want to enable automatic shutdown into an appropriate Organizational Unit (OU):
Active Directory console showing a 'GPO USERS' organizational unit with a user account.
  • Next, open the Group Policy Management console:
Run dialog showing the 'gpmc.msc' command to open Group Policy Management Console.
  • Right-click the target OU, then select Create a GPO in this domain, and Link it here…
Group Policy Management interface showing the option to create and link a GPO to an organizational unit.
  • Assign a name to the new GPO:
New GPO creation window showing 'Auto_Shutdown' as the name, with no starter GPO selected.
  • Edit the GPO to configure its settings:
Group Policy Management with the Edit option selected for the 'Auto_Shutdown' GPO.
  • Navigate to User Configuration > Preferences > Control Panel Settings, then right-click on Scheduled Tasks and choose New > Scheduled Task (At least Windows 7):
Group Policy Management Editor with the option to create a new scheduled task for at least Windows 7.

Configure the Group Policy Object

  • Set the properties of the New Task as follows:
    • Action: Create
    • Name: Auto_Shutdown
    • User Account: System (⚠️ Type it manually; do not use the "Change User or Group… button.⚠️)
Note: You can also use the System account's universal SID: S-1-5-18 (source: learn.microsoft.com). Task properties for Auto_Shutdown showing general settings and user account configuration.
  • Under the Triggers tab, click New:
Triggers tab in Task Properties window with the 'New' button highlighted.
  • Set the time when the computers should shut down:
New Trigger window showing a daily schedule set to 4:20 PM.
  • In the Actions tab, click on New:
Screenshot of the New Task properties window with the Actions tab open and the New button highlighted to create a new action.
  • Define the properties of the New Action as follows:
    • Action: Start a program
    • Program/script: C:\Windows\System32\shutdown.exe
    • Add arguments(optional): /s /t 0
New Action window with shutdown.exe configured using the arguments '/s /t 0'.
  • In the Conditions tab, configure the task to avoid shutting down if a user is still active:

This ensures that shutdown only occurs when the computer is idle, preventing interruption during user activity (e.g. working overtime).

Conditions tab of the Auto_Shutdown task, set to start only if the computer is idle for 30 minutes.

Verify from a User Workstation

  • On a workstation, open the Task Scheduler with administrator privileges. (Without admin rights, the task may not be visible.) You should see the Auto_Shutdown task listed:
Task Scheduler showing the Auto_Shutdown task with status, triggers, and security options.

Note: To prevent the task from being deployed on servers, consider using WMI Filters to ensure the GPO applies only to client workstations.