{"record":{"id":"089b9758ab209401","repo":"peass-ng/PEASS-ng","slug":"the-current-version-of-the-native-library-1-osli","errorCode":null,"errorMessage":"The current version of the native library (1.{osLibMinorVer}) does not support the original or minimum version of the \"{iTask.Name}\" task ({xmlVer}/1.{newMinor}). This is likely due to attempting to read the remote tasks of a newer version of Windows from a down-level client.","messagePattern":"The current version of the native library \\(1\\.(.+?)\\) does not support the original or minimum version of the \"(.+?)\" task \\((.+?)/1\\.(.+?)\\)\\. This is likely due to attempting to read the remote tasks of a newer version of Windows from a down-level client\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"winPEAS/winPEASexe/winPEAS/TaskScheduler/Task.cs","lineNumber":1635,"sourceCode":"                        !dd.Contains(\"Source\") &&\n                        !dd.Contains(\"URI\") &&\n                        !dd.Contains(\"AllowStartOnDemand\", \"true\", true) &&\n                        !dd.Contains(\"AllowHardTerminate\", \"true\", true) &&\n                        !dd.Contains(\"MultipleInstancesPolicy\", \"IgnoreNew\", true) &&\n                        !dd.Contains(\"NetworkSettings\") &&\n                        !dd.Contains(\"StartWhenAvailable\", \"false\", true) &&\n                        !dd.Contains(\"SendEmail\") &&\n                        !dd.Contains(\"ShowMessage\") &&\n                        !dd.Contains(\"ComHandler\") &&\n                        !dd.Contains(\"EventTrigger\") &&\n                        !dd.Contains(\"SessionStateChangeTrigger\") &&\n                        !dd.Contains(\"RegistrationTrigger\") &&\n                        !dd.Contains(\"RestartOnFailure\") &&\n                        !dd.Contains(\"LogonType\", \"None\", true))\n                        newMinor = 1;\n\n                    if (newMinor > osLibMinorVer && throwError)\n                        throw new InvalidOperationException($\"The current version of the native library (1.{osLibMinorVer}) does not support the original or minimum version of the \\\"{iTask.Name}\\\" task ({xmlVer}/1.{newMinor}). This is likely due to attempting to read the remote tasks of a newer version of Windows from a down-level client.\");\n\n                    if (newMinor != xmlVer.Minor)\n                    {\n                        dd.Version = new Version(1, newMinor);\n                        var def = svc.v2TaskService.NewTask(0);\n                        def.XmlText = dd.Xml;\n                        return def;\n                    }\n                }\n                return iTask.Definition;\n            }\n            catch (COMException comEx)\n            {\n                if (throwError)\n                {\n                    if ((uint)comEx.ErrorCode == 0x80041318 && xmlVer.Minor != osLibMinorVer) // Incorrect XML value\n                        throw new InvalidOperationException($\"The current version of the native library (1.{osLibMinorVer}) does not support the version of the \\\"{iTask.Name}\\\" task ({xmlVer})\");\n                    throw;","sourceCodeStart":1617,"sourceCodeEnd":1653,"githubUrl":"https://github.com/peass-ng/PEASS-ng/blob/53fb989abc2219826385683a6fee826bd6cd38d6/winPEAS/winPEASexe/winPEAS/TaskScheduler/Task.cs#L1617-L1653","documentation":"When reading a task's XML definition, the library computes the minimum Task Scheduler version the definition requires. If that required minor version exceeds what the local native library (1.{osLibMinorVer}) supports and throwError is set, it throws InvalidOperationException — typically when enumerating tasks created on a newer Windows version from a down-level client (e.g. Win7 reading Win10 tasks).","triggerScenarios":"Enumerating/connecting to a task store whose tasks were registered with features newer than the client's native library supports; a task XML requiring version 1.{newMinor} while the client is 1.{osLibMinorVer} with newMinor > osLibMinorVer.","commonSituations":"Remote task enumeration from an older OS to a newer one (Win7 client → Win10 server); tasks using newer triggers/settings unavailable in older Task Scheduler; migrating task definitions between machines.","solutions":["Run the enumeration from a client OS at least as new as the machine that registered the tasks","Use TaskService.Connect with matching OS versions, or upgrade the client to Windows 10+","Set throwError=false to skip/adjust unsupported tasks instead of throwing","Downgrade the offending task's XML version manually (the library attempts to trim unsupported features)"],"exampleFix":"// before\nforeach (var t in remoteFolder.Tasks) Console.WriteLine(t.Definition.XmlText);\n// after\nforeach (var t in remoteFolder.GetTasks(throwError: false))\n    Console.WriteLine(t.Definition.XmlText);","handlingStrategy":"try-catch","validationCode":"if (newMinor > osLibMinorVer)\n    Console.WriteLine($\"Task {taskName} requires v1.{newMinor}; local library supports 1.{osLibMinorVer}\");","typeGuard":null,"tryCatchPattern":"try { EnumerateTasks(folder); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"native library\"))\n{ /* skip task or re-run from a newer client */ }","preventionTips":["Enumerate remote tasks from a client OS of equal or newer version than the server","Use throwError:false when enumerating heterogeneous environments","Keep client and remote Windows versions aligned"],"tags":["taskscheduler","version-mismatch","interop","remote"],"backgroundTag":"scheduler-version-mismatch","analyzedSha":"53fb989abc2219826385683a6fee826bd6cd38d6","analyzedAt":"2026-09-02T04:25:09.259Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}