

- #WINDOWS RESTART OPTIONS GREYED OUT HOW TO#
- #WINDOWS RESTART OPTIONS GREYED OUT CODE#
- #WINDOWS RESTART OPTIONS GREYED OUT WINDOWS#
Now, I would like to point out that I still do not consider myself a Powershell expert. I'd highly recommend running these commands on a test server before running them on production servers! But un-doing the commands above (in case of any issues) involves changing two sections of code: You save the invoke command to a $result variable and then output that variable to another text file and append to that same file for each server that you run the script on.ĭon't forget to include a $cred that actually has administrative rights to the machine. Then, assuming you are a good enterprise admin and got WinRM or Powershell remoting or whatever access you need to run commands remotely on those servers, you run a foreach loop and invoke the script on each of those servers:įoreach ($server in $servers) Have a list of servers ready in a text file.
#WINDOWS RESTART OPTIONS GREYED OUT CODE#
We save this code to some script: disable2016Reboots.ps1. Powershell to the rescue!ĭisabling the scheduled task is easy enough:
#WINDOWS RESTART OPTIONS GREYED OUT HOW TO#
To apply this change using the way enterprise administrators want, the key thing to teach in these articles is how to perform these steps using the command-line. But when you have dozens (hundreds?) of machines to manage, any great GUI solution is still a half-baked solution. There's also some further instructions on that same link on how to change the permissions of the task so that it doesn't auto-enable itself.įor those of us in the enterprise world, articles that give you a solution to an issue are great.

After disabling the task, the unintended reboots of the server stop.

#WINDOWS RESTART OPTIONS GREYED OUT WINDOWS#
It seems that a scheduled reboot task is built into Windows Server 2016 (as well as Windows 10) and is basically buried. You also get a lot of links to frustrated systems administrators who cannot figure out why their mission critical servers continue to reboot when they should be up and running 24/7.Īlthough it looks like some people found the link above useful, it did not work for me.Īfter a lot more Google searching and frustration at not being able to solve the issue, I ran across a link that finally started to shed some light on the issue: When you run Google searches on it, you get links like this: So, any time outside of that twelve hour block, the server could (and probably would) reboot. You can adjust the "Active Hours", but the span of twelve hours remains. Outside of this twelve hour (I'm fairly certain it's twelve) window, after applying Windows Updates, the server can possibly reboot on its own. The issue basically boils down to Windows 2016 Servers have something called "Active Hours" enabled on them (I'm not sure if 2019 is also afflicted). I guess this falls into the category of "it seemed like a good idea at the time." I'm not really sure who decided it was a good idea to try and force Windows 2016 servers to auto-reboot, thus leaving systems administrators holding the bag, trying to figure out how to stop these servers from doing exactly what their Microsoft overloads designed them to do.
