Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » Windows Scheduled task last run result 0x1

Windows Scheduled task last run result 0x1

Terri Donahue
Terri Donahue
Reply

I have installed the Windows task scheduler and noticed that it will not run successfully. The switch from curl.exe to invoke-webrequest causes an issue with execution policy. The command runs from a normal powershell window but will not run as an scheduled task. I have set every switch I can think of to get around the exectution failure but haven't been successful. Any ideas on how ot get this to work so I don't have to updated the action on every task to point it back to curl.exe?


Replies

 
Terri Donahue
Terri Donahue
Reply

Actually, the error in Task Scheduler is misleading. Checking the logs, the tasks are running. Sorry for the firedrill.

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Isn't it still an error then? Would it make sense to post the error so the development team can take a look?

 
Terri Donahue
Terri Donahue
Reply

Here is the error from the task scheduler

windows-task-error.png
 
Nicolai Pedersen
Reply

Could be execution profile... Did you try one or more of these?

powershell.exe -NoProfile -NoLogo -NonInteractive -ExecutionPolicy Bypass
 
Terri Donahue
Terri Donahue
Reply

Hi Nicolai,

I tried all those switches except for -NoLogo previously and got the error. I just ran it with all of those and still get a last run result of 0x1. It is definitely the Execution Policy from what I have been able to narrow down. If I set a user that isn't System, it will complete successfully.

 
Nicolai Pedersen
Reply

So, it might be related to some Windows things that are over my paygrade... I'll ask our service desk if they know what to do.

BR Nicolai

 
Morten Snedker Dynamicweb Employee
Morten Snedker
Reply
This post has been marked as an answer

The webrequest uses the IE engine for processing request/response, and maybe you run into some security/policy restrictions for IE. Try and add a -UseBasicParsing parameter to the parameter list. This will ditch IE for processing. Downside is that plain text (no DOM) is returned - but that should be all good in this context. Try it out and let me know if there was success.

Best regards
Morten

Votes for this answer: 1
 
Terri Donahue
Terri Donahue
Reply

Winner Winner Chicken Dinner. That was the needed switch Morten. I didn't even think about the IE engine.

 

You must be logged in to post in the forum