I know you can create and edit the actions and triggers of a scheduled task via CMD, but when I open the created task in Task Scheduler all of the Conditions are set to their default configurations. I've tried looking them up in the microsoft documentation but all I've been able to find are the switches /options for the actions and triggers portion of the scheduled task.
I'd like to be able to do this via Command line so that I can deploy this scheduled task to all of our Windows 10 workstations with PDQ deploy.
For reference, here is the command I am currently working with
'schtasks /create /tn SeatSaver /tr "taskkill /F /IM Executable.EXE" /sc
ONIDLE /i 60 /ru domain\username /rp password'
according to the documentation this command should create a task that kills a certain program after 60 minutes of the Workstation being idle. But when I open up the created task and look at the conditions, the options for conditions are all at their default settings, which to me means that the command won't work as is, because the default setting for idling is to not care if the PC is idle, which I don't want.
Is there anyway to make this work via CMD?
Edit: I've read through Microsoft's Powershell Documentation for this, but I wasn't able to find anything regarding the "OnIdle" trigger, or if it even exists. Does anyone have a list of Triggers for setting up scheduled tasks with Powershell?
/U
switch? That is for connecting to a remote system, which you are not doing. When I ran the command using/RU
switch it works as expected. – Greg Askew Jul 31 '18 at 12:47