I downloaded ScheduledTask2XML and moved it into EXEXML under the Custom Sensors and setup a new custom sensor. Under Parameters I put in -c=Servername -t=taskname but I keep getting the error can't find task on this server. Anyone else run into this issue and if so is there a fix for this.

Thanks


Article Comments

Hi mattsy,

Open a commandline window in the folder where the executable is located and execute it this way: ScheduledTask2XML.exe -c="hostname" -u="domain\username" -p="password" -l (Last parameter is small letter "L")

What result do you get?

Kind regards.


Apr, 2016 - Permalink

This helped me. The task name needs to have \ in front of it else it won't find it.


Apr, 2016 - Permalink

I'm running into the same issue, here is my command and command line output:

PS D:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXEXML> .\ScheduledTask2XML.exe -c=server.domain.net -t= "\job name" -u=domain\user -p=password -l

16.2.2.3
Check if Remote Registry Service is running.
<?xml version="1.0" encoding="utf-8"?><prtg><error>1</error><text>Cannot open Service Control Manager on computer 'server.domain.net'. This operation might require other privileges.</text></prtg>

I verified the remote registry service is running on the remote PC and that the account I am using is a domain admin so permission 'should' not be an issue.


Jun, 2017 - Permalink

Hi there,

Please try to put all parameters into quotes and check if this works:

.\ScheduledTask2XML.exe -c=server.domain.net -t= "\job name" -u="domain\user" -p="password"

Please note that the "-l" switch in the end only should be used when no job name is defined. So both "-t" and "-l" won't work. The parameters "-l" lists all available tasks.

Best regards.


Jun, 2017 - Permalink

I confirmed that the task name is correct, and provided proper credentials and I receive the following message via command-line on Win2012 R2. Any ideas?

16.2.2.3
Check if Remote Registry Service is running.
Remote Registry Service is running.
<?xml version="1.0" encoding="utf-8"?><prtg><error>1</error><text>The task XML contains a value which is incorrectly formatted or out of range. (Exception from HRESULT: 0x80041318)</text></prtg>

Jun, 2017 - Permalink

Hi there,

As the error message states, have you checked that there is no Firewall or Software that could block the network access? If so, then make sure that the Remote Registry Service is started on the target machine.

Best regards.


Jun, 2017 - Permalink

Hi, I have the same issue.

When I use the following command line I get a list of tasks which are in the PC specified. So the parameters must be alright. ScheduledTask2XML.exe -c=servername -t="\path\taskname" -l


Without the "-L" I get the following error: 16.2.2.3 Check if Remote Registry Service is running. Remote Registry Service is running. <?xml version="1.0" encoding="utf-8"?><prtg><error>1</error><text>The task XML contains a value which is incorrectly formatted or out of range. RESULT: 0x80041318</text></prtg>

Best regards

23.08.2017 - Modification small letter of L


Aug, 2017 - Permalink

Hi Kara,

So when you run "ScheduledTask2XML.exe -c=servername -L" you get the tasks listed? Try adding username and password: ScheduledTask2XML.exe -c=servername -t="\path\taskname" -u="domain\username" -p="password"

Kind regards,

Erhard


Aug, 2017 - Permalink

Hi Erhard,

thanks for your response.

If I use this row of parameters, with the smaller letter of L, I get the task list, yes ScheduledTask2XML.exe -c=servername -t="\path\taskname" -u="domain\username" -p="password" -l

Without the small letter of L, I get the mentioned error.

Kind regards Kara


Aug, 2017 - Permalink

Dear Kara,

please clarify, does the sensor work as intended with the small-letter l, or are there open questions?


Aug, 2017 - Permalink

After lot of tries implementing this type of sensor I noticed that only for some tasks it reported the error.

"<?xml version="1.0" encoding="utf-8"?><prtg><error>1</error><text>The task XML contains a value which is incorrectly formatted or out of range. (Exception from HRESULT: 0x80041318)</text></prtg>"

I've found that this issue occurs only with scheduled tasks that are "Configured for: Windows Server 2012 R2" , changing that option to "Windows7, 2008R2" solved it.

I hope it helps.


Nov, 2017 - Permalink

I use the sensor to monitor several tasks on the same server All in the same folder, all run with the same user.. Only two of them run into an error: Incorrect function called for 'Task Result'

Is there any way to troubleshoot that?


Sep, 2023 - Permalink