For this EXAMPLE, we'll be creating a task to restart amachine running windows OS
Open Task Scheduler.Click on Task Scheduler Library. Right click then select “create basic task”.
Create Basic Task
Enter the task nameand description and click on “next”.
Select the schedule or interval you want then click on “next”.
Select “Start a Program” and click “next”.
**This will be the unique part for what you want yourtask to do, in this example we're restarting the machine.**
In command type“powershell” and for the arguments type “restart-computer” or “restart-computer-force” then click on “next”.
Sometimes it’snecessary to use the ‘SYSTEM’ account to avoid the task process depending on auser account/password. Also, I typically check the box for highest privileges.You’ve created a task to restart your Windows 2012 server. Now you can click on“Finish”.