Describe the bug
When running the "(Re)create scheduled task" command, wacs.exe fails to create the task and shows error "System.ArgumentException: Value does not fall within the expected range.".
To Reproduce
- Run wacs.exe
- Pick menu option
O: More options...
- Pick menu option
T: (Re)create scheduled task
- Press enter to skip entering a user the task will run as
- See error message
Expected behavior
Scheduled task should create successfully.
Log
Win-Acme Log
2023-07-27 08:26:57.204 -04:00 [INF] Adding Task Scheduler entry with the following settings
2023-07-27 08:26:57.205 -04:00 [INF] - Name E:/Win-Acme/config renew (acme-v02.api.letsencrypt.org)
2023-07-27 08:26:57.205 -04:00 [INF] - Path E:\Win-Acme\application
2023-07-27 08:26:57.206 -04:00 [INF] - Command wacs.exe --renew --baseuri "https://acme-v02.api.letsencrypt.org/"
2023-07-27 08:26:57.206 -04:00 [INF] - Start at "09:00:00"
2023-07-27 08:26:57.207 -04:00 [INF] - Random delay "04:00:00"
2023-07-27 08:26:57.207 -04:00 [INF] - Time limit "02:00:00"
2023-07-27 08:26:58.735 -04:00 [DBG] Creating task to run as system user
2023-07-27 08:26:58.742 -04:00 [ERR] Failed to create task
System.ArgumentException: Value does not fall within the expected range.
at Microsoft.Win32.TaskScheduler.V2Interop.ITaskFolder.RegisterTaskDefinition(String Path, ITaskDefinition pDefinition, Int32 flags, Object UserId, Object password, TaskLogonType LogonType, Object sddl)
at Microsoft.Win32.TaskScheduler.TaskFolder.RegisterTaskDefinition(String path, TaskDefinition definition, TaskCreation createType, String userId, String password, TaskLogonType logonType, String sddl)
at PKISharp.WACS.Services.TaskSchedulerService.CreateTaskScheduler(RunLevel runLevel)
Windows Event Viewer Error
Failed to create task
System.ArgumentException: Value does not fall within the expected range.
at Microsoft.Win32.TaskScheduler.V2Interop.ITaskFolder.RegisterTaskDefinition(String Path, ITaskDefinition pDefinition, Int32 flags, Object UserId, Object password, TaskLogonType LogonType, Object sddl)
at Microsoft.Win32.TaskScheduler.TaskFolder.RegisterTaskDefinition(String path, TaskDefinition definition, TaskCreation createType, String userId, String password, TaskLogonType logonType, String sddl)
at PKISharp.WACS.Services.TaskSchedulerService.CreateTaskScheduler(RunLevel runLevel)
Platform:
- OS: Windows Server 2019 Datacenter Version 1809
- Version: 2.2.5.1541 (release, pluggable, standalone, 64-bit)
- Plugins: validation plugin Cloudflare
Additional context
- Error occurs both when provided a specific user account to run the task as and when using the default "n" option
- Error occurs with Carbon Black Defense (antivirus) enabled and disabled
Happy to provide additional context or details as needed. I'm a bit stumped on what I should try next.
Describe the bug
When running the "(Re)create scheduled task" command, wacs.exe fails to create the task and shows error "System.ArgumentException: Value does not fall within the expected range.".
To Reproduce
O: More options...T: (Re)create scheduled taskExpected behavior
Scheduled task should create successfully.
Log
Win-Acme Log
Windows Event Viewer Error
Platform:
Additional context
Happy to provide additional context or details as needed. I'm a bit stumped on what I should try next.