Icinga Powershell Framework - error "Parameter is incorrect" 0x80070057 Register-ScheduledTask, or Start-ScheduledTask

Parameter is incorrect

I have a set of currently 37 Windows servers with Icinga Powershell framework installed, and configured as Agent, reporting to a distributed Icinga2 environment.
Where 10 of those servers look good with their default Invoke-IcingaCheck…s, 27 of the servers do have issues:

Register-ScheduledTask : The parameter is incorrect.
At C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:25028 char:5

  • Register-ScheduledTask -User 'System' -TaskName $TaskName -Action ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (PS_ScheduledTask:Root/Microsoft/…S_ScheduledTask) [Register-Schedule
      dTask], CimException
    • FullyQualifiedErrorId : HRESULT 0x80070057,​Register-ScheduledTask

Start-ScheduledTask : The parameter is incorrect.
At C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:25030 char:5

  • Start-ScheduledTask -TaskName $TaskName -TaskPath $TaskPath;
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (PS_ScheduledTask:Root/Microsoft/…S_ScheduledTask) [Start-ScheduledTa
      sk], CimException
    • FullyQualifiedErrorId : HRESULT 0x80070057,​Start-ScheduledTask

Register-ScheduledTask : The parameter is incorrect.
At C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:25028 char:5

  • Register-ScheduledTask -User 'System' -TaskName $TaskName -Action ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (PS_ScheduledTask:Root/Microsoft/…S_ScheduledTask) [Register-Schedule
      dTask], CimException
    • FullyQualifiedErrorId : HRESULT 0x80070057,​Register-ScheduledTask

Start-ScheduledTask : The parameter is incorrect.
At C:\Program Files\WindowsPowerShell\Modules\icinga-powershell-framework\cache\framework_cache.psm1:25030 char:5

  • Start-ScheduledTask -TaskName $TaskName -TaskPath $TaskPath;
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (PS_ScheduledTask:Root/Microsoft/…S_ScheduledTask) [Start-ScheduledTa
      sk], CimException
    • FullyQualifiedErrorId : HRESULT 0x80070057,​Start-ScheduledTask

The servers being ok are both Datacenter 2019 and Datacenter 2022 versions.
The servers with failing messages are also both Datacenter 2019/2022.

All systems had been recently installed with the scriplet provided via [https://icinga.com/docs/icinga-for-windows/latest/doc/110-Installation/01-Getting-Started/#install-icinga-for-windows]

I am totally lost how to troubleshoot or even fix the issue, as all Powershell Plugin checks are reporting back in green (“OK”), whereas showing those error at the same time, rather than providing valid check data.

Any help is really appreciated.

One of the failing systems:

**  Icinga PowerShell Framework v1.12.2  **
Environment configuration:
PowerShell Root                 => C:\Program Files\WindowsPowerShell\Modules\
Icinga for Windows Service Path => C:\Program Files\icinga-framework-service
Icinga for Windows Service User => NT Authority\NetworkService
Icinga for Windows Service Pid  =>
Icinga for Windows JEA Pid      =>
Icinga Agent Path               =>
Icinga Agent User               => NT Authority\NetworkService
Defined Default User            =>
Icinga Managed User             => False
PowerShell Version              => 5.1.17763.5696
Operating System                => Microsoft Windows Server 2019 Datacenter
Operating System Version        => 10.0.17763
JEA Context                     =>
JEA Session File                =>
Api Check Forwarder             => False
Debug Mode                      => False

Hey, I just found your post, I have the same issue in a handful of machines, did you find out the fix?

Cheers