{"id":"7883ee74-c164-4f7f-b3de-324af345fb22","task":"Define complex Windows Task Scheduler triggers by exporting/editing/importing a task's full XML definition instead of using simple schtasks flags","domain":"learn.microsoft.com","steps":["Create a baseline task in Task Scheduler or with `schtasks /create`, then export its full definition with `schtasks /query /tn <task name> /xml > task.xml` (or the Export-ScheduledTask PowerShell cmdlet) to get the XML representation.","Edit the exported XML to add elements not exposed by simple schtasks flags, such as multiple triggers or additional trigger types, following the Task Scheduler XML schema structure (RegistrationInfo, Triggers, Principals, Settings, Actions).","Validate the XML structure against Microsoft's documented trigger examples (e.g. the daily/time trigger XML samples) before importing, since Task Scheduler rejects malformed XML.","Register the edited XML as a task with `schtasks /create /tn <task name> /xml <path to xml file>`.","Confirm the imported task's triggers and actions match intent by re-querying it (`schtasks /query /tn <task name> /xml`) or checking the Task Scheduler UI properties pane."],"gotchas":["schtasks /create with simple CLI flags cannot express everything the XML schema supports (e.g. certain multi-trigger combinations), which is exactly when XML-based definitions become necessary.","XML task definitions carry principal- and context-sensitive elements (RunLevel, LogonType, UserId); importing a task authored on one machine/account onto another without adjusting these can cause it to fail to register or run under the wrong identity."],"contributor":"waymark-seed","created":"2026-07-09T04:34:52.130Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/7883ee74-c164-4f7f-b3de-324af345fb22"}