Link to home
Start Free TrialLog in
Avatar of Andrew
AndrewFlag for United States of America

asked on

Task Scheduler .vbs pass windows authentication?

Hello,

I am trying to set up a scheduled task using a .vbs that simply opens an .aspx that resides on the same box (WinServer2008 R2 Standard SP1).  The .aspx updates a database nightly.  The problem I am having is that the website is using Windows Authentication and requires credentials.  How can I pass credentials via the .vbs, or is there a better way to go about this?  Anonymous access is not an option, although the process works when it is allowed.

 Call PTRBilling()
 Sub PTRBilling()     
     'On Error Resume Next
     'Declare variables 
     Dim objRequest 
     Dim URL 
     Set objRequest = CreateObject("MSXML2.ServerXMLHTTP.6.0") 
     'Put together the URL link appending the Variables. 
     URL = "http://xxxxxx.org/PTRBilling.aspx" 
     'URL = "https://www.google.com" 
     'Open the HTTP request and pass the URL to the objRequest object 
     objRequest.open "GET", URL, false 
     'Send the HTML Request 
     objRequest.Send 
     'Set the object to nothing 
     Set objRequest = Nothing
     WScript.Echo "Done"
 End Sub

Open in new window


Thanks,
Andrew
Avatar of FarWest
FarWest

this is the parameter for open function of the object

objRequest.open bstrMethod, bstrUrl, varAsync, bstrUser, bstrPassword
ASKER CERTIFIED SOLUTION
Avatar of FarWest
FarWest

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial