{"record":{"id":"4f6f67af0ea6de46","repo":"peass-ng/PEASS-ng","slug":"xml-validation-not-available-on-task-scheduler-1-0","errorCode":null,"errorMessage":"XML validation not available on Task Scheduler 1.0.","messagePattern":"XML validation not available on Task Scheduler 1\\.0\\.","errorType":"exception","errorClass":"NotV1SupportedException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/TaskScheduler/TaskFolder.cs","lineNumber":570,"sourceCode":"            }\n            definition.v1Task.SetFlags(flags);\n\n            switch (createType)\n            {\n                case TaskCreation.Create:\n                case TaskCreation.CreateOrUpdate:\n                case TaskCreation.Disable:\n                case TaskCreation.Update:\n                    if (createType == TaskCreation.Disable)\n                        definition.Settings.Enabled = false;\n                    definition.V1Save(path);\n                    break;\n                case TaskCreation.DontAddPrincipalAce:\n                    throw new NotV1SupportedException(\"Security settings are not available on Task Scheduler 1.0.\");\n                case TaskCreation.IgnoreRegistrationTriggers:\n                    throw new NotV1SupportedException(\"Registration triggers are not available on Task Scheduler 1.0.\");\n                case TaskCreation.ValidateOnly:\n                    throw new NotV1SupportedException(\"XML validation not available on Task Scheduler 1.0.\");\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(createType), createType, null);\n            }\n            return new Task(TaskService, definition.v1Task);\n        }\n\n        /// <summary>\n        /// Applies access control list (ACL) entries described by a <see cref=\"TaskSecurity\"/> object to the file described by the current <see cref=\"TaskFolder\"/> object.\n        /// </summary>\n        /// <param name=\"taskSecurity\">A <see cref=\"TaskSecurity\"/> object that describes an access control list (ACL) entry to apply to the current folder.</param>\n        public void SetAccessControl([NotNull] TaskSecurity taskSecurity) { taskSecurity.Persist(this); }\n\n        /// <summary>\n        /// Sets the security descriptor for the folder. Not available to Task Scheduler 1.0.\n        /// </summary>\n        /// <param name=\"sd\">The security descriptor for the folder.</param>\n        /// <param name=\"includeSections\">Section(s) of the security descriptor to set.</param>\n        [Obsolete(\"This method will be removed in deference to the SetAccessControl and SetSecurityDescriptorSddlForm methods.\")]","sourceCodeStart":552,"sourceCodeEnd":588,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/TaskScheduler/TaskFolder.cs#L552-L588","documentation":"V1 capability check in RegisterTaskDefinition: TaskCreation.ValidateOnly (XML/schema validation of the definition before saving) is implemented on top of the 2.0 XML model, which the legacy 1.0 API lacks; the guard throws NotV1SupportedException so callers do not mistake a successful no-validation registration for a validated one.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/TaskScheduler/TaskFolder.cs:570 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Validate the TaskDefinition manually (e.g. via XmlSerializationHelper output or custom checks) before registering on V1","Use TaskCreation.Create/CreateOrUpdate on V1 and rely on ValidateOnly only where Task Scheduler 2.0+ is available"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}