Created
March 5, 2013 15:20
-
-
Save jhorsman/5091024 to your computer and use it in GitHub Desktop.
Windows Task Scheduler task to shutdown the server after specified hours of idle time. This file can be imported in Windows Task Scheduler.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-16"?> | |
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"> | |
<RegistrationInfo> | |
<Date>2013-03-05T14:01:44.319601</Date> | |
<Author>TRAIN1\Administrator</Author> | |
<Description>Shut down the server after specified hours of idle time</Description> | |
</RegistrationInfo> | |
<Triggers> | |
<IdleTrigger> | |
<Enabled>true</Enabled> | |
</IdleTrigger> | |
</Triggers> | |
<Principals> | |
<Principal id="Author"> | |
<UserId>TRAIN1\Administrator</UserId> | |
<LogonType>Password</LogonType> | |
<RunLevel>LeastPrivilege</RunLevel> | |
</Principal> | |
</Principals> | |
<Settings> | |
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy> | |
<DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries> | |
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries> | |
<AllowHardTerminate>true</AllowHardTerminate> | |
<StartWhenAvailable>true</StartWhenAvailable> | |
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable> | |
<IdleSettings> | |
<Duration>PT4H</Duration> | |
<WaitTimeout>PT3H</WaitTimeout> | |
<StopOnIdleEnd>true</StopOnIdleEnd> | |
<RestartOnIdle>true</RestartOnIdle> | |
</IdleSettings> | |
<AllowStartOnDemand>true</AllowStartOnDemand> | |
<Enabled>true</Enabled> | |
<Hidden>false</Hidden> | |
<RunOnlyIfIdle>true</RunOnlyIfIdle> | |
<WakeToRun>false</WakeToRun> | |
<ExecutionTimeLimit>P3D</ExecutionTimeLimit> | |
<Priority>7</Priority> | |
</Settings> | |
<Actions Context="Author"> | |
<Exec> | |
<Command>shutdown</Command> | |
<Arguments>/s /f</Arguments> | |
</Exec> | |
</Actions> | |
</Task> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment