GPO for Scheduled Task Server 2008 R2 (Computer reboot)

scheduled-taskwindows-server-2008-r2

I am currently running into a bit of a problem. I am trying to create a GPO that reboots all computers in a specific OU at a specific time using Server 2008 R2 64 bit.

I have gone into GP management, created a new GPO, went to computer configuration, preferences, control panel settings, then scheduled tasks.

Right clicked and created a new scheduled task as follows:

Action: Create
Name: Test Reboot
Run: shutdown.exe /f /r
username: admin
pass: pass
Scheduled to run at said time I want.

The GPO replicates as needed. I see it in computer management, but it never runs and gives an error message in the history. The error message is as follows:

Task Scheduler failed to launch action "shutdown.exe /f /r" in instance "{5171f2bf-de1c-4fae-bbb8-e8db9370ed1f}" of task "\Test Reboot". Additional Data: Error Value: 2147942403.

Am I using the wrong command? If I am can you please tell me what I should be using?

Best Answer

Command shutdown.exe /f /r seems to be ok, but I would check some settings in your scheduled task.

When you specify program to run as scheduled task, you shuold write parameters (arguments) in separate field named Arguments. In your case, you should set Run: shutdown.exe and Arguments: /f /r.