Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Task Scheduler .vbs pass windows authentication?

Posted on 2015-02-19
2
Medium Priority
?
198 Views
Last Modified: 2015-04-01
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
0
Comment
Question by:Ahelbling
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 12

Expert Comment

by:FarWest
ID: 40619406
this is the parameter for open function of the object

objRequest.open bstrMethod, bstrUrl, varAsync, bstrUser, bstrPassword
0
 
LVL 12

Accepted Solution

by:
FarWest earned 2000 total points
ID: 40619410
but it is better to have a dedicated user with limited privilege to run this url since the password will be passed as string
0

Featured Post

Supports up to 4K resolution!

The VS192 2-Port 4K DisplayPort Splitter is perfect for anyone who needs to send one source of DisplayPort high definition video to two or four DisplayPort displays. The VS192 can split and also expand DisplayPort audio/video signal on two or four DisplayPort monitors.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
Check out the latest tech news, community articles, and expert highlights in August's newsletter.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question