Reputation: 23
I want to use an EC2 windows instance as an development environment, and want it to shutdown automatically when there is X period of user inactivity (either no remote desktop connection or idle RD connection), so as to minimize costs. Any way to do this?
Upvotes: 2
Views: 455
Reputation: 46
You can use task scheduler inside of the windows machine to set up a trigger that will shut down the machine when it is inactive.
open the task scheduler (assuming windows 7 or 8 just type it in to search for it in the start/search box)
on the right actions box create a task
give it a name
Run whether user is logged on or not
Run with highest privileges (shutdown requires admin rights)
Click Triggers tab
New...
Begin the task: set to on idle
click ok
click conditions tab
Check mark start the task only if the computer is idle for (your amount of idle time)
check restart if the idle state resumes
Click the Actions Tab
New...
program = cmd.exe
add arguments = shutdown /s /f
Should be good to go after that
Upvotes: 3