{"record":{"id":"a589e1601f28f6ad","repo":"peass-ng/PEASS-ng","slug":"specified-argument-was-out-of-the-range-of-valid-v-a589e1","errorCode":null,"errorMessage":"Specified argument was out of the range of valid values. (Parameter 'logonType')","messagePattern":"Specified argument was out of the range of valid values\\. \\(Parameter 'logonType'\\)","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/TaskScheduler/TaskFolder.cs","lineNumber":551,"sourceCode":"                case TaskLogonType.InteractiveToken:\n                    flags |= (TaskFlags.RunOnlyIfLoggedOn | TaskFlags.Interactive);\n                    definition.v1Task.SetAccountInformation(user.Name, IntPtr.Zero);\n                    break;\n                case TaskLogonType.ServiceAccount:\n                    flags &= ~(TaskFlags.Interactive | TaskFlags.RunOnlyIfLoggedOn);\n                    definition.v1Task.SetAccountInformation((String.IsNullOrEmpty(userId) || user.IsSystem) ? String.Empty : user.Name, IntPtr.Zero);\n                    break;\n                case TaskLogonType.InteractiveTokenOrPassword:\n                    flags |= TaskFlags.Interactive;\n                    using (CoTaskMemString cpwd = new CoTaskMemString(password))\n                        definition.v1Task.SetAccountInformation(user.Name, cpwd.DangerousGetHandle());\n                    break;\n                case TaskLogonType.Password:\n                    using (CoTaskMemString cpwd = new CoTaskMemString(password))\n                        definition.v1Task.SetAccountInformation(user.Name, cpwd.DangerousGetHandle());\n                    break;\n                default:\n                    throw new ArgumentOutOfRangeException(nameof(logonType), logonType, null);\n            }\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:","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/TaskScheduler/TaskFolder.cs#L533-L569","documentation":"Default case of the V1 logonType switch in RegisterTaskDefinition: the supplied TaskLogonType value is not one of the variants the legacy SetAccountInformation path can map (InteractiveToken, ServiceAccount, TokenOrPassword, Interactive, etc.), so the unmapped enum value falls through to ArgumentOutOfRangeException on the logonType parameter. The faulting input is the logonType argument itself.","triggerScenarios":"Thrown at winPEAS/winPEASexe/winPEAS/TaskScheduler/TaskFolder.cs:551 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use one of the V1-supported logon types: InteractiveToken, ServiceAccount, TokenOrPassword, Interactive or None","Target Task Scheduler 2.0+ (the v2Folder code path) if a newer logon type such as S4U, Group or InteractiveTokenOrPassword is required"],"exampleFix":null,"handlingStrategy":"validation","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"}