peass-ng/PEASS-ng · error · NotV1SupportedException

XML validation not available on Task Scheduler 1.0.

Error message

XML validation not available on Task Scheduler 1.0.

What it means

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.

Source

Thrown at winPEAS/winPEASexe/winPEAS/TaskScheduler/TaskFolder.cs:570

            }
            definition.v1Task.SetFlags(flags);

            switch (createType)
            {
                case TaskCreation.Create:
                case TaskCreation.CreateOrUpdate:
                case TaskCreation.Disable:
                case TaskCreation.Update:
                    if (createType == TaskCreation.Disable)
                        definition.Settings.Enabled = false;
                    definition.V1Save(path);
                    break;
                case TaskCreation.DontAddPrincipalAce:
                    throw new NotV1SupportedException("Security settings are not available on Task Scheduler 1.0.");
                case TaskCreation.IgnoreRegistrationTriggers:
                    throw new NotV1SupportedException("Registration triggers are not available on Task Scheduler 1.0.");
                case TaskCreation.ValidateOnly:
                    throw new NotV1SupportedException("XML validation not available on Task Scheduler 1.0.");
                default:
                    throw new ArgumentOutOfRangeException(nameof(createType), createType, null);
            }
            return new Task(TaskService, definition.v1Task);
        }

        /// <summary>
        /// Applies access control list (ACL) entries described by a <see cref="TaskSecurity"/> object to the file described by the current <see cref="TaskFolder"/> object.
        /// </summary>
        /// <param name="taskSecurity">A <see cref="TaskSecurity"/> object that describes an access control list (ACL) entry to apply to the current folder.</param>
        public void SetAccessControl([NotNull] TaskSecurity taskSecurity) { taskSecurity.Persist(this); }

        /// <summary>
        /// Sets the security descriptor for the folder. Not available to Task Scheduler 1.0.
        /// </summary>
        /// <param name="sd">The security descriptor for the folder.</param>
        /// <param name="includeSections">Section(s) of the security descriptor to set.</param>
        [Obsolete("This method will be removed in deference to the SetAccessControl and SetSecurityDescriptorSddlForm methods.")]

View on GitHub (pinned to 53fb989abc)

Solutions

  1. Validate the TaskDefinition manually (e.g. via XmlSerializationHelper output or custom checks) before registering on V1
  2. Use TaskCreation.Create/CreateOrUpdate on V1 and rely on ValidateOnly only where Task Scheduler 2.0+ is available
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at winPEAS/winPEASexe/winPEAS/TaskScheduler/TaskFolder.cs:570 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of peass-ng/PEASS-ng@53fb989abc (2026-09-02). Data as JSON: /api/errors/4f6f67af0ea6de46. Report an issue: GitHub.