Xiaofeng, when a sched task won’t work but the URL works in a browser, it’s 
nearly always an issue of the URL being behind a form of authentication that CF 
can’t support (as a scheduled task or CFHTTP call) but the browser can. 

As for why it could “no problem” from the browser, it’s usually that your 
browser has cached the credentials, so you’re not seeing that they are required 
and requested, and passed in by the browser.

Here’s a simple test you can do: if using Chrome, open a “new incognito window” 
(via the “hamburger” menu in the top right). If in FF, use the same to open a 
“new private window”. In either case, visit the URL, and if there is a need of 
authentication, you will be prompted for it. If you are not, let us know. If 
you ARE prompted, then you need to find out if IIS is configured (whether at 
the folder or site level) to require authentication (see the “authentication” 
feature in the IIS control panel), and if so, and it’s only supporting “windows 
authentication”, then that’ why you can’t access the URL as a sched task. CF 
does not support that.

Let us know what you find.

/charlie

 

From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf Of 
Xiaofeng Liu
Sent: Sunday, November 15, 2015 11:40 PM
To: cfaussie@googlegroups.com
Subject: [cfaussie] CF11 Scheduled Task Not Running - 401 Unauthorized

 

Hi folks,

 

I'm running out of options. Basically I have a CF site running on Windows 2012 
R2 & IIS 8.5.

 

I have two scheduled tasks sit under a sub directory of the web root directory.

 

In IIS 8.5 even from the webroot folder I set the IIS authentication to 
'Anonymous Authentication' Enabled and it is using the option 'Application pool 
identity'.

 

Now when I run the scheduled task from the CF Admin, I got status code 401 - 
Unauthorized in the CF http.log.

 

But, if I directly run the URL of the scheduled task in a browser, it works 
without any problem.

 

When I googled, I realized that other people got the same issue but pretty much 
is because of Windows Authentication is turned on and anonymous authentication 
is turned off. But in my case, I got anonymous authentication even from the 
root.

 

Also I tried to set 'IUSR' for the anonymous authentication but still got the 
same issue.

 

Could anyone kindly shed some light if you had similar experience before?

 

-- 

Best regards,

Xiaofeng,

-- 
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cfaussie+unsubscr...@googlegroups.com.
To post to this group, send email to cfaussie@googlegroups.com.
Visit this group at http://groups.google.com/group/cfaussie.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cfaussie+unsubscr...@googlegroups.com.
To post to this group, send email to cfaussie@googlegroups.com.
Visit this group at http://groups.google.com/group/cfaussie.
For more options, visit https://groups.google.com/d/optout.

Reply via email to