Issues getting computer restart GPO to work on local computers

Chris Evans 0 Reputation points
2024-01-03T13:34:22.12+00:00

Hello everyone. I'm having an issue with getting my weekly restart GPO to work properly. I have tested the script being used for the command on my system and it works just fine. However, it appears that the Task Scheduler task (that was applied via GPO) failed to run properly.

I received the following error code: 0x80070057 (bad parameter).

Task scheduler screenshot

This is the code I'm running with the task/GPO: C:\Windows\System32\shutdown.exe /r /c "1 hour until automated computer restart. Please save your work." /t 6000 /f

I am running the task this way as I am inexperienced at linking BAT files on the DC and am not sure if the task that is pushed out to the computers can see what's on the DC and get what they need.

Here is my General tab for the scheduled GPO:

General screenshot

The task is scheduled to run every Sunday at midnight. I have the policy configured to wake the computer to run this task. My settings screenshot is provided below. Help is appreciated. Thank you.

Settings screenshot

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2024-01-05T01:53:54.1+00:00

    Hello Chris Evans,

    Thank you for posting in Q&A forum.

    I can see Scheduled Tasks under User Configuration and Computer Configuration, because you want to set computer to restart, I understand you have configured Scheduled Tasks under Computer Configuration.
    Untitled

    1.Create an OU and put all the machines you want to apply this Scheduled Tasks.
    2.Create GPO and link it to OU above.
    3.Edit this GPO. You can follow the steps as "Step 3: Create the Scheduled Reboot GPO" in the link below.

    Note: You do not need to set "3. Exclude Group (optional)" within "Step 3: Create the Scheduled Reboot GPO" in the link.

    How to Schedule Windows Reboot using Group Policy
    https://activedirectorypro.com/schedule-windows-reboot-using-group-policy/

    I hope the information above is helpful.

    If you have any questions or concerns, please feel free to let us know.

    Best Regards,
    Daisy Zhou

    ============================================

    If the Answer is helpful, please click "Accept Answer" and upvote it.

    1 person found this answer helpful.
    0 comments No comments

  2. Chris Evans 0 Reputation points
    2024-01-05T16:52:54.9766667+00:00

    Thank you for your response. I managed to get the restart script to work with a batch file and running it on the domain controller (it tells the computers on the network to restart through Task Scheduler). It's a little more cumbersome (had to add all the computers in question to the script) but my command prompt batch file appears to be working.

    Thank you again.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.