Get-ScheduledTaskInfo
Use Get-ScheduledTaskInfo to return run history for a scheduled task: last run time, last result and next run time.
Documentation: Microsoft Learn — PowerShell module reference
Syntax
See the command anatomy
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Get-ScheduledTaskInfo [-TaskName] <String> [-TaskPath <String>] [-CimSession <CimSession[]>] [<CommonParameters>]- Stage 1Get-ScheduledTaskInfo
-TaskName -TaskPath -CimSession
Try it
PowerShell example · browser support is limited.
Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.
Follow the objects
Run the command to inspect each stage.
Examples
Get-ScheduledTask -TaskPath \
Show reference output
Sample output · fictional data, shaped like the real thing
TaskName LastRunTime LastTaskResult ----------- --------------------- -------------- Backup 9/10/2026 10:00:01 PM 0 Maintenance 9/9/2026 3:00:00 AM 0
Get-ScheduledTaskInfo -TaskName MyTask
Show reference output
Sample output · fictional data, shaped like the real thing
LastTaskResult NextRunTime -------------- --------------------- 0 9/11/2026 10:00:00 PM 0
Get-ScheduledTaskInfo -TaskName MyTask (2)
Show reference output
Sample output · fictional data, shaped like the real thing
TaskPath TaskName State LastTaskResult ------------------- ----------- -------- -------------- \ Backup Ready 0 \Microsoft\Windows\ Maintenance Disabled 0
Parameters
Parameter definitions:
-TaskName-TaskPath-CimSession
Practical use and troubleshooting
Practical scenario: Use Get-ScheduledTaskInfo when you need to return run history for a scheduled task: last run time, last result and next run time. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.
Common error and fix: A nonzero LastTaskResult requires decoding the task or process result and inspecting history. Check the action, account and working directory before assuming the scheduler itself failed. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.
See also: Get-ScheduledTask. Get-ScheduledTask returns task configuration; Get-ScheduledTaskInfo returns runtime information such as LastRunTime and LastTaskResult. An enabled task definition is not evidence of a successful last run. Read the linked command before substituting it; similar names do not imply identical inputs or output.
Recap
Get-ScheduledTaskInfo Use Get-ScheduledTaskInfo to return run history for a scheduled task: last run time, last result and next run time.
Next: Get-Date