Solved

Task Scheduler .vbs pass windows authentication?

Posted on 2015-02-19
2
96 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
  • 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 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now