In the task scheduler GUI it is easy to Enable All Tasks History
See also https://mcmap.net/q/117328/-how-can-i-enable-the-windows-server-task-scheduler-history-recording
How can I Enable All Tasks History through PowerShell?
I have looked at Set-ScheduledTask
and New-ScheduledTask
, but nothing useful there (as far as I can see).