Related to this question:
Windows Server in UTC, need Task Scheduler to shift tasks with summer time
and this question:
Is there a way to selectively enable and disable certain triggers (not the whole task) with powershell?
I have two "Daily" triggers on my task on my UTC server, one scheduled to run an hour after the other. I only want one to be enabled, and I want to toggle between them twice a year.
The Task Scheduler doesn't appear to have a unique "name" for the triggers, they just appear as "Daily"
There are lots of ways to interface with Task Scheduler. For example, you can use the Schedule.Service COM object.
Those trigger objects each have an Enabled property. I think the array indices here start at 1, which is weird, but whatever.
Edit: And oh yeah, the RegisterTaskDefinition() method should save your changes.
I wanted to disable a trigger that runs at user logon. Piggybacking off the other answer, here's a complete example.