Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 
o.send 

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
add comment

1 Answer

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:

o.open "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
add comment

Your Answer

 
discard

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.