0

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?

MadHatter
  • 79,770
  • 20
  • 184
  • 232
Mike K
  • 99
  • 4
  • 10
  • your admin account likely doesn't have "logon as batch job" rights. However, what are you doing that you need to reboot servers via GPO? – HostBits Mar 18 '13 at 16:22
  • Hi, its not for servers. This is for computers around the office. How do I add those rights? – Mike K Mar 18 '13 at 16:25
  • Also, the machine im using to test the GPO on, says that the logon as batch job is set for the administrators group. The admin account is in there. – Mike K Mar 18 '13 at 16:41

1 Answers1

1

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.

betatester07
  • 142
  • 5
  • im going to give this a try now, apparently the shutdown.exe has issues. Someone told me to try powershell and use restart-computer. Do you know anything about that? – Mike K Mar 20 '13 at 15:02
  • When I use powershell, it tells me the user account does not have permission to run this task. Im logged in as the domain admin account and as stated before, I have the logon as batch job permission too. Actually, let me change this statement. If im not logged in as a domain admin it wont run. Logged in as normal user, it wont reboot. – Mike K Mar 20 '13 at 15:06
  • I have set the tasks to run as an admin. IM going to test not running it as an admin. – Mike K Mar 20 '13 at 15:11
  • No, go just says I dont have permissions. – Mike K Mar 20 '13 at 15:17
  • do you have UAC enabled? I am not sure, it can help, but just for testing I would try to disable it. as a normal local user, you dont have permission to shut down computer - you must have Shutdown privilege (and as far as I know, also Force shutdown form remote system privilege) – betatester07 Mar 20 '13 at 18:53
  • UAC is disabled. Im starting to think, after googleing and what not, this cant be done through and will need to be done via a script. I have created this and it seems to work. schtasks /create /ru Administrator /rp password /sc weekly /D SAT /st 23:59:00 /tn shutdown /tr "shutdown /f 0 /r" – Mike K Mar 20 '13 at 21:21
  • Let me ask this, does anyone here know the parameters for creating a script that only restarts certain specified OU's? – Mike K Mar 21 '13 at 21:55
  • are you deploying your script via group policy? – betatester07 Mar 22 '13 at 11:01
  • I wanted to do it via GPO but for whatever reason, it wont deploy via GPO. I have set it up right, I look up good instructions but its not replicating to computers. Any ideas? All other GPO's replicate good. – Mike K Mar 22 '13 at 16:04
  • you should post, how you set up GPO and maybe some logs or error messages you get – betatester07 Mar 22 '13 at 20:03
  • Let me look at it this way now, do any of you know how to create a script that will reboot specific computers in an OU? I could then have a server run this script. – Mike K Mar 26 '13 at 16:06