The machine is XP Pro standalone. This script will do what I want it
to do if I include the correct "password" for the user currently logged
on. Is there a variable I can dim for the user's password? I don't
care what the user's password is and it can stay
hidden/encrypted/whatever as long as I can pass it into a form in IE.
The external form has our company name, user and password as available
fields for use as an employee time clock. The user/password is the
same externally as it is for the local machine...

Here is what I currently have copied/constructed:

'Start
Dim ie
Set ie = CreateObject("InternetExplorer.Application")
ie.navigate "https://external.website/Login.asp"
Do Until IE.readyState = 4
WScript.sleep(200)
Loop
Set WSHNetwork = CreateObject("WScript.Network")
ie.visible=1
Dim oUser
Dim strUserName
strUserName = wshNetwork.UserName
Dim oAlias 'Company name
Dim oPwd
Dim oDoc
Set oDoc = IE.document
Set oAlias = oDoc.getElementById("Text1")
Set oUser = oDoc.getElementById("Text2")
Set oPwd = oDoc.getElementById("Password1")
oAlias.value = "company"
oUser.value = strUserName
oPwd.value = "password"
oUser.form.submit
'End

Thanks in advance for any advice.

Andy

Re: Is there a way to pass a current XP user's password into an IE by Bob

Bob
Wed Jun 14 17:02:16 CDT 2006

freshtech@gmail.com wrote:
> The machine is XP Pro standalone. This script will do what I want it
> to do if I include the correct "password" for the user currently logged
> on. Is there a variable I can dim for the user's password? I don't
> care what the user's password is and it can stay
> hidden/encrypted/whatever as long as I can pass it into a form in IE.
> The external form has our company name, user and password as available
> fields for use as an employee time clock. The user/password is the
> same externally as it is for the local machine...


If you /could/ do that with it, then you could pass it to a site you
control, then do anything at all with it.

See the problem?


Bob
--

Re: Is there a way to pass a current XP user's password into an IE form? by freshtech

freshtech
Thu Jun 15 07:37:22 CDT 2006


>
>
> If you /could/ do that with it, then you could pass it to a site you
> control, then do anything at all with it.
>
> See the problem?
>
>
> Bob
> --

I do. I have read so much conflicting information that I figured a
post to this group would put it to rest for me one way or another, and
you did just that.

Thanks - Andy


Re: Is there a way to pass a current XP user's password into an IE form? by Justin

Justin
Thu Jun 15 09:14:39 CDT 2006

On Wed, 14 Jun 2006 15:59:08 -0500, <freshtech@gmail.com> wrote:

> The machine is XP Pro standalone. This script will do what I want it
> to do if I include the correct "password" for the user currently logged
> on. Is there a variable I can dim for the user's password? I don't
> care what the user's password is and it can stay
> hidden/encrypted/whatever as long as I can pass it into a form in IE.
> The external form has our company name, user and password as available
> fields for use as an employee time clock. The user/password is the
> same externally as it is for the local machine...

Since you describe it as an "external form" this might not be an option,
but have you looked into using IIS's Integrated Windows authentication
method? From Microsoft's documentation[1]:

The current Windows user information on the client is used for
Integrated Windows authentication. If the authentication exchange
initially fails to authorize the user, Internet Explorer prompts the
user for a Windows account user name and password, which it processes
using Integrated Windows authentication. Internet Explorer prompts the
user for the correct user name and password up to three times. If,
however, the user has logged on to the local computer as a domain user,
then no authentication is required when the user accesses a network
computer in that domain.

[1] Integrated Windows Authentication (IIS 6.0)
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/523ae943-5e6a-4200-9103-9808baa00157.mspx

--
Justin Piper
Bizco Technologies
http://www.bizco.com/

Re: Is there a way to pass a current XP user's password into an IE form? by Leslie

Leslie
Thu Jun 22 11:35:35 CDT 2006

This is exactly the situation I'm facing. I'd rather not have a
password hard-coded into my script, but that's the only way I can
automate my access to a specific web page. What would VBScript code
that uses Integrated Windows Authentication to pass the user's name and
password to the remote web page look like? I'm relatively new to
VBScript, and can't seem to find any examples.

Thanks in advance to all who respond!

Leslie

Justin Piper wrote:
> On Wed, 14 Jun 2006 15:59:08 -0500, <freshtech@gmail.com> wrote:
>
> > The machine is XP Pro standalone. This script will do what I want it
> > to do if I include the correct "password" for the user currently logged
> > on. Is there a variable I can dim for the user's password? I don't
> > care what the user's password is and it can stay
> > hidden/encrypted/whatever as long as I can pass it into a form in IE.
> > The external form has our company name, user and password as available
> > fields for use as an employee time clock. The user/password is the
> > same externally as it is for the local machine...
>
> Since you describe it as an "external form" this might not be an option,
> but have you looked into using IIS's Integrated Windows authentication
> method? From Microsoft's documentation[1]:
>
> The current Windows user information on the client is used for
> Integrated Windows authentication. If the authentication exchange
> initially fails to authorize the user, Internet Explorer prompts the
> user for a Windows account user name and password, which it processes
> using Integrated Windows authentication. Internet Explorer prompts the
> user for the correct user name and password up to three times. If,
> however, the user has logged on to the local computer as a domain user,
> then no authentication is required when the user accesses a network
> computer in that domain.
>
> [1] Integrated Windows Authentication (IIS 6.0)
> http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/523ae943-5e6a-4200-9103-9808baa00157.mspx
>
> --
> Justin Piper
> Bizco Technologies
> http://www.bizco.com/


Re: Is there a way to pass a current XP user's password into an IE form? by Justin

Justin
Thu Jun 22 17:13:30 CDT 2006

On Thu, 22 Jun 2006 11:35:35 -0500, Leslie Houk <lhouk@ghg.net> wrote:
> This is exactly the situation I'm facing. I'd rather not have a
> password hard-coded into my script, but that's the only way I can
> automate my access to a specific web page. What would VBScript code
> that uses Integrated Windows Authentication to pass the user's name and
> password to the remote web page look like? I'm relatively new to
> VBScript, and can't seem to find any examples.

It's a feature of IIS, rather than something specific to VBScript. You
need to enable it in IIS Manager, disable anonymous access, and I believe
you also need to be on the same domain as the web server. You can find
more information about enabling it on Microsoft's site.

Configuring Integrated Windows Authentication in IIS 6.0
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5f8fe119-4095-4094-bba5-7dec361c7afe.mspx

Below I have included a short example that demonstrates automating
Internet Explorer below. If anonymous access has been disabled and
Integrated Windows Authentication is enabled on the web server, it will
attempt to automatically log in. If that fails, it will display a prompt
for the username and password. If that fails, it will give up and exit.

Option Explicit

Const Url = "http://localhost/auth/test.asp"
Const ProgId = "InternetExplorer.Application"
Const Prefix = "IE_"

Const Status_Unauthorized = 401

Dim finished : finished = False
Dim navcomplete : navcomplete = False

' Open Internet Explorer and navigate to the web page
Dim ie: Set ie = WScript.CreateObject(ProgId, Prefix)
ie.Navigate2 Url

' Wait for the signal to quit
Do Until finished : WScript.Sleep 100 : Loop

' Internet Explorer will call this subroutine when the web page has
' been found and the server has replied
Sub IE_NavigateComplete2(pdisp, url)
navcomplete = True
End Sub

' Internet Explorer will call this subroutine when the page has
' finished loading, and sometimes just for kicks
Sub IE_DownloadComplete()
If navcomplete = True Then
WScript.Echo ie.Document.Body.InnerText
finished = True
End If
End Sub

' Internet Explorer will call this subroutine if it was not able to
' find the web page
Sub IE_NavigateError(pdisp, url, target, status, cancel)
Select Case status
' This status code is used when IIS was not able to
' authenticate the user
Case Status_Unauthorized: WScript.Echo "Unable to log in."
finished = True
End Select
End Sub

There are a number of other such examples on the web. Searching for
"InternetExplorer.Application" should turn up more information.

--
Justin Piper
Bizco Technologies
http://www.bizco.com/

Re: Is there a way to pass a current XP user's password into an IE form? by Leslie

Leslie
Fri Jun 23 09:57:02 CDT 2006

Justin Piper wrote:
> It's a feature of IIS, rather than something specific to VBScript. You
> need to enable it in IIS Manager, disable anonymous access, and I believe
> you also need to be on the same domain as the web server. You can find
> more information about enabling it on Microsoft's site.
>
> Configuring Integrated Windows Authentication in IIS 6.0
> http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5f8fe119-4095-4094-bba5-7dec361c7afe.mspx
>

Justin,

Thanks for the response. I tried to start IIS on my system,
following the instructions in the following Microsoft page:

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/b0c14479-83e3-435d-a935-819fe396e7d2.mspx?mfr=true

However, I don't seem to have IIS. Is IIS available in
Windows XP SP2, or is it only available with Windows
Server 2003?

Thanks again,
Leslie


Re: Is there a way to pass a current XP user's password into an IE form? by Justin

Justin
Fri Jun 23 13:01:44 CDT 2006

On Fri, 23 Jun 2006 09:57:02 -0500, Leslie Houk <lhouk@ghg.net> wrote:
> However, I don't seem to have IIS. Is IIS available in
> Windows XP SP2, or is it only available with Windows
> Server 2003?

If it is, it will be listed in the Add/Remove Windows Components window in
the Add/Remove Programs control panel. I know Windows 2000 Professional
came with it.

--
Justin Piper
Bizco Technologies
http://www.bizco.com/

Re: Is there a way to pass a current XP user's password into an IE form? by Tim

Tim
Sat Jun 24 13:41:17 CDT 2006

You'll need XP Pro: the home version doesn't have IIS.

Tim

"Leslie Houk" <lhouk@ghg.net> wrote in message news:1151074622.407450.146840@g10g2000cwb.googlegroups.com...
> Justin Piper wrote:
>> It's a feature of IIS, rather than something specific to VBScript. You
>> need to enable it in IIS Manager, disable anonymous access, and I believe
>> you also need to be on the same domain as the web server. You can find
>> more information about enabling it on Microsoft's site.
>>
>> Configuring Integrated Windows Authentication in IIS 6.0
>> http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5f8fe119-4095-4094-bba5-7dec361c7afe.mspx
>>
>
> Justin,
>
> Thanks for the response. I tried to start IIS on my system,
> following the instructions in the following Microsoft page:
>
> http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/b0c14479-83e3-435d-a935-819fe396e7d2.mspx?mfr=true
>
> However, I don't seem to have IIS. Is IIS available in
> Windows XP SP2, or is it only available with Windows
> Server 2003?
>
> Thanks again,
> Leslie
>