{"record":{"id":"ee2b1908166ae41d","repo":"peass-ng/PEASS-ng","slug":"notsupportedpriortoexception","errorCode":null,"errorMessage":"NotSupportedPriorToException","messagePattern":"NotSupportedPriorToException","errorType":"exception","errorClass":"NotSupportedPriorToException","httpStatus":null,"severity":"warning","filePath":"winPEAS/winPEASexe/winPEAS/TaskScheduler/Task.cs","lineNumber":3487,"sourceCode":"        [XmlIgnore]\n        public bool UseUnifiedSchedulingEngine\n        {\n            get\n            {\n                if (v2Settings2 != null)\n                    return v2Settings2.UseUnifiedSchedulingEngine;\n                if (v2Settings3 != null)\n                    return v2Settings3.UseUnifiedSchedulingEngine;\n                return false;\n            }\n            set\n            {\n                if (v2Settings2 != null)\n                    v2Settings2.UseUnifiedSchedulingEngine = value;\n                else if (v2Settings3 != null)\n                    v2Settings3.UseUnifiedSchedulingEngine = value;\n                else\n                    throw new NotSupportedPriorToException(TaskCompatibility.V2_1);\n                OnNotifyPropertyChanged();\n            }\n        }\n\n        /// <summary>Gets or sets a boolean value that indicates whether the task is automatically disabled every time Windows starts.</summary>\n        /// <exception cref=\"NotSupportedPriorToException\">Property set for a task on a Task Scheduler version prior to 2.2.</exception>\n        [DefaultValue(false)]\n        [XmlIgnore]\n        public bool Volatile\n        {\n            get => v2Settings3 != null && v2Settings3.Volatile;\n            set\n            {\n                if (v2Settings3 != null)\n                    v2Settings3.Volatile = value;\n                else\n                    throw new NotSupportedPriorToException(TaskCompatibility.V2_2);\n                OnNotifyPropertyChanged();","sourceCodeStart":3469,"sourceCodeEnd":3505,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/TaskScheduler/Task.cs#L3469-L3505","documentation":"NotSupportedPriorToException signals that a property introduced in Task Scheduler 2.1 (Windows 7/Server 2008 R2) is being used on a task running on an older engine. UseUnifiedSchedulingEngine requires v2Settings2 (V2.1) or v2Settings3 (V2.2); when neither interface is available the setter throws with TaskCompatibility.V2_1. The library enforces minimum OS/compatibility versions per property.","triggerScenarios":"Setting Task.Settings.UseUnifiedSchedulingEngine on a task whose underlying settings object is only V2.0 or V1 — i.e. running on Windows Vista/Server 2008 or earlier, or on a task definition whose Compatibility is below V2_1.","commonSituations":"Managing scheduled tasks remotely on pre-Win7 machines; a codebase written for Win7+ deployed to Server 2008; copying a task definition that uses the unified scheduling engine to an older host.","solutions":["Verify the target machine/TaskScheduler supports V2_1 (Windows 7 / Server 2008 R2 or newer) before setting the property","Set the TaskDefinition's Compatibility to TaskCompatibility.V2_1 or higher so the V2.1 settings interface is created","Guard the assignment with a version/compatibility check and skip the property on older systems","Catch NotSupportedPriorToException and degrade gracefully if the setting is optional"],"exampleFix":"// before\ntask.Definition.Settings.UseUnifiedSchedulingEngine = true;\n// after\nif (task.Definition.Settings.Compatibility >= TaskCompatibility.V2_1)\n    task.Definition.Settings.UseUnifiedSchedulingEngine = true;\nelse\n    Log(\"UseUnifiedSchedulingEngine requires Task Scheduler 2.1+\");","handlingStrategy":"validation","validationCode":"if (def.Settings.Compatibility < TaskCompatibility.V2_1) { Log(\"Requires TS 2.1\"); return; }\ndef.Settings.UseUnifiedSchedulingEngine = true;","typeGuard":"bool SupportsV2_1(TaskDefinition def) => def != null && def.Settings.Compatibility >= TaskCompatibility.V2_1;","tryCatchPattern":"try { def.Settings.UseUnifiedSchedulingEngine = v; } catch (NotSupportedPriorToException) { Log(\"Requires Win7+/TS 2.1\"); }","preventionTips":["Confirm OS baseline (Win7/2008R2+) before using 2.1 features","Keep task definitions at Compatibility >= V2_1 when using unified scheduling","Feature-detect rather than assume when managing remote machines"],"tags":["taskscheduler","compatibility","version-gate"],"backgroundTag":"task-scheduler-version-unsupported","analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}