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") 
o.open "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?

1 Answer 1


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:

o.open "GET", "http://.../UpdateCache", False, username, password
  • That makes sense, but even after supplying credentials I'm still getting denied.
    – Paul
    Apr 4, 2012 at 20:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .