Is there a way of getting the task scheduler history information into an array or variable inside a batch or PowerShell script.
For example, get the information such as task name, date and time when the task started (event ID: 100 ) and when it completed (event ID: 102). This is so I can update a SQL database with the information. (the sql table may look like this and I know how to insert into the database once ive got the information)
TaskName TaskStart TaskCompleted
task1 27/09/2017 09:00:00 27/09/2017 10:00:00
task2 27/09/2017 12:00:00 27/09/2017 16:00:00
task1 04/10/2017 09:00:00 04/09/2017 09:55:00
Basically I don't know how to retrieve that information, if it is even possible. thanks