{"record":{"id":"751cb103a2c0c876","repo":"peass-ng/PEASS-ng","slug":"tasks-which-have-been-registered-previously-with-s","errorCode":null,"errorMessage":"Tasks which have been registered previously with stored passwords must use the TaskFolder.RegisterTaskDefinition method for updates.","messagePattern":"Tasks which have been registered previously with stored passwords must use the TaskFolder\\.RegisterTaskDefinition method for updates\\.","errorType":"exception","errorClass":"SecurityException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/TaskScheduler/Task.cs","lineNumber":1358,"sourceCode":"            return ret;\n        }\n\n        /// <summary>Gets the security descriptor for the task. Not available to Task Scheduler 1.0.</summary>\n        /// <param name=\"includeSections\">Section(s) of the security descriptor to return.</param>\n        /// <returns>The security descriptor for the task.</returns>\n        /// <exception cref=\"NotV1SupportedException\">Not supported under Task Scheduler 1.0.</exception>\n        public string GetSecurityDescriptorSddlForm(SecurityInfos includeSections = defaultSecurityInfosSections) => v2Task != null ? v2Task.GetSecurityDescriptor((int)includeSections) : throw new NotV1SupportedException();\n\n        /// <summary>\n        /// Updates the task with any changes made to the <see cref=\"Definition\"/> by calling <see\n        /// cref=\"TaskFolder.RegisterTaskDefinition(string, TaskDefinition)\"/> from the currently registered folder using the currently\n        /// registered name.\n        /// </summary>\n        /// <exception cref=\"System.Security.SecurityException\">Thrown if task was previously registered with a password.</exception>\n        public void RegisterChanges()\n        {\n            if (Definition.Principal.RequiresPassword())\n                throw new SecurityException(\"Tasks which have been registered previously with stored passwords must use the TaskFolder.RegisterTaskDefinition method for updates.\");\n            if (v2Task != null)\n                TaskService.GetFolder(System.IO.Path.GetDirectoryName(Path)).RegisterTaskDefinition(Name, Definition, TaskCreation.Update, null, null, Definition.Principal.LogonType);\n            else\n                TaskService.RootFolder.RegisterTaskDefinition(Name, Definition);\n        }\n\n        /// <summary>Runs the registered task immediately.</summary>\n        /// <param name=\"parameters\">\n        /// <para>\n        /// The parameters used as values in the task actions. A maximum of 32 parameters can be supplied. To run a task with no parameters,\n        /// call this method without any values (e.g.\n        /// <code>Run()</code>\n        /// ).\n        /// </para>\n        /// <para>\n        /// The string values that you specify are paired with names and stored as name-value pairs. If you specify a single string value,\n        /// then Arg0 will be the name assigned to the value. The value can be used in the task action where the $(Arg0) variable is used in\n        /// the action properties.","sourceCodeStart":1340,"sourceCodeEnd":1376,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/TaskScheduler/Task.cs#L1340-L1376","documentation":"This error signals that a task update was attempted (e.g. via TaskDefinition changes re-registered directly) while the task's stored credentials include a password, which the Task Scheduler API forbids updating in place. Such tasks must be re-registered through TaskFolder.RegisterTaskDefinition with fresh credentials; the message documents this API limitation rather than a runtime fault.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/TaskScheduler/Task.cs:1358 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-register the task with TaskFolder.RegisterTaskDefinition instead of calling RegisterChanges or Update on it.","Change the logon type (e.g. to ServiceAccount or InteractiveToken) so no password is stored, then update normally.","Delete and recreate the task definition if in-place re-registration keeps failing."],"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"}