Dumping Scheduled Tasks

by Mar 19, 2013

There is an underestimated option to make schtasks.exe dump scheduled tasks as CSV data. PowerShell can grab the CSV data and turn it into objects, creating reports with all scheduled tasks in just one line:

schtasks.exe /query /fo csv | ConvertFrom-Csv | Where-Object { $_.TaskName -ne 'TaskName' } | 
Sort-Object TaskName |
Out-GridView -Title 'All scheduled tasks'

If you think that was cool, wait until you add the switch /V for verbose output:

schtasks.exe /query /v /fo csv | ConvertFrom-Csv | Where-Object { $_.TaskName -ne 'TaskName' } | 
Sort-Object
TaskName | Out-GridView -Title 'All scheduled tasks'

You can even query remote computers when you add the /S Servername switch.

Twitter This Tip! ReTweet this Tip!