There have been innumerable times that I have had to schedule a Windows Server restart for after hours so that I don’t have to log back in after hours to do this manually. So here is a quick command to schedule a reboot at 11:59 PM (copy & paste for greater degree of simplicity):
schtasks /CREATE /SC once /TN “Windows Server Restart” /TR “shutdown /r /t 0 /f” /ST 23:59 /RL highest
This should be done within an administrative command prompt. Leave the server logged in for it to complete successfully (this is highly recommended not to do) or change the one setting in the Task Scheduler to run the Windows Server Restart task as a particular user.