I stumbled across a cool tidbit of information this morning. I was attempting to export a long list of scheduled jobs from the Windows Task Scheduler, but was thinking that I’d have to either build a powershell script to do it for me, or manually export each task individually, and then aggregate all the results.
Not so! Turns out there’s a command for that.
schtasks /query /S SERVERNAME /FO CSV /V > exportedjobs.csv
This will take all scheduled tasks (including system jobs), and export them to a file named exportedjobs.csv
in your current working directory.
Then, you can import this into Excel and massage the data however you’d like.
Cool, huh?
Read Next: How I Earn Passive Income by Hosting Websites for Others
very cool and better than most hints which just say how to export a single task using right click in the task GUI.
It should be mentioned that SERVERNAME can be omitted for the local computer or set to a valid value.
To make this clear in the command I would change the line to: schtasks /query /S %COMPUTERNAME% /FO CSV /V > exportedjobs.csv
🙂 I do that all the time.
This does not seem to be exporting all tasks. I just upgraded to Windows 10. Worked great in the past.
Any update to this?
Tiptop! Thanks for posting
The above does not Export all tasks. I missing many. I want what is displayed in the Task Scheduler Library folder. What am I missing?
Is there a way to export a list of the individual actions within each task as well to a csv?
Excellent tip. Thank you very much for this. It was exactly what I was looking for.