Home > Back-end >  Powershell - how to get list of all jobs that had runs in the last hour From TASK Scheduler
Powershell - how to get list of all jobs that had runs in the last hour From TASK Scheduler

Time:10-04

how can I by using Powershell, Get the list of all the Jobs that runs from TASK Scheduler with this filters:

  1. only tasks that runs in the last hour
  2. from sub TASK Scheduler library that is not Microsoft?

layout needed - name of the job, which time have been run, end time (if ended).

CodePudding user response:

get-scheduledtask|where-object{$_.taskpath -notmatch "^\\Microsoft"}|get-scheduledtaskinfo|where-object{$_.lastruntime -gt (get-date).addhours(-1)}
  • Related