Restart in task scheduler – Global Policy Object configuration

Often, when dealing with Windows devices in production, such as terminals on the factory floor, there may be a need for periodic restarts, such as nightly or weekly.

The simplest way is to create a scheduled task that will restart the computer at a specified time. But what if we have a large number of computers? You can create a scheduled task using Group Policy Objects (GPO), and today I will show you how to configure it.

First, we need to create a policy that will include the scheduled task.


Once you have created the policy, proceed to the „Scheduled Tasks” section and create a new task there.


In the next step, give the task a name and choose the account to run the task. In the „Triggers” tab, set the task’s start time. I chose every Saturday at 1 AM.

In the „Actions” tab, specify what the task should do. In my case, I want to restart the computer, so I will use the shutdown command. In the „Program/script” field, enter: C:\Windows\system32\shutdown.exe, and in the „Add arguments” field, enter: /r /f.

After saving the changes, your task will appear in the policy.

Now, all you need to do is link the policy to the appropriate Organizational Unit (OU) and wait for the policy to apply to the computer. You can expedite this process by using the command gpupdate /force.

Here, you can see the task that has appeared on the computer. It’s important to note that to view this task, you need to run Task Scheduler as an administrator.

Komentarze

Nie ma jeszcze komentarzy. Może zaczniesz dyskusję?

Dodaj komentarz

Twój adres e-mail nie zostanie opublikowany. Wymagane pola są oznaczone *