Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I setup a scheudled task on Windows Server 2008 to run the following command:

C:\Windows\System32\cscript.exe //b //nologo D:\WebSites\MySite\Scripts\UpdateCache.vbs

The VBScript being run makes a simple GET request:

Dim o 
Set o = CreateObject("MSXML2.XMLHTTP") "GET", "http://.../UpdateCache", False 

When I check the IIS logs after this runs, it always results in a 401. The user running the scheduled task has read/write/modify access to the website folder and can access it through IE. Any idea why I might be getting the 401 when running this task?

share|improve this question
up vote 2 down vote accepted

The reason you receive a 401.2 is because the XMLHTTP request object doesn't supply credentials. You can do that in the open-method: "GET", "http://.../UpdateCache", False, username, password
share|improve this answer
That makes sense, but even after supplying credentials I'm still getting denied. – Paul Apr 4 '12 at 20:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.