|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
VBScript - General - Question - NT Logon
Hi
Does anyone have a script that captures the NTLogon in asp The only way I can keep a track of the person accessing the site is by capturing the NTLogon. I have tried the following code;but it is not returning any value. Request.ServerVariables("AUTH_USER") Can someone pls help. Thanks |
|
#2
|
|||
|
|||
|
Name = Request.ServerVariables("LOGON_USER")
This will tell you who is logged onto the computer. |
|
#3
|
||||
|
||||
|
Request.ServerVariables("AUTH_USER") or ("LOGON_USER") will not return a value if anonymous access is enabled. You need to open IIS and make sure that Windows Integrated Authentication is enabled on the Security tab.
|
|
#4
|
|||
|
|||
|
Quote:
Hi, Neither Username = Request.ServerVariables("LOGON_USER") nor Username = Request.ServerVariables("AUTH_USER") are working. Any other wayout? Thanks |
|
#5
|
||||
|
||||
|
Quote:
Have you enabled Windows Integrated Authentication? |
|
#6
|
|||
|
|||
|
Quote:
Yes, authentication is enabled |
|
#7
|
||||
|
||||
|
Quote:
And anonymous access is disabled in IIS? |
|
#8
|
||||
|
||||
|
You can use this code to display the contents of the whole Request.ServerVariables collection so you can see what they contain:
Code:
<TABLE>
<TR>
<TD>
<B>Server Varriable</B>
</TD>
<TD>
<B>Value</B>
</TD>
</TR>
<% For Each name In Request.ServerVariables %>
<TR>
<TD>
<%= name %>
</TD>
<TD>
<%= Request.ServerVariables(name) %>
</TD>
</TR>
<% Next %>
</TABLE>
|
|
#9
|
|||
|
|||
|
Quote:
---------- Hi, Thanks Its working now. I was checking at the wrong server. Thanks |
|
#10
|
||||
|
||||
|
Quote:
LOL!! You're welcome, glad you got it working!! |
|
#11
|
|||
|
|||
|
Quote:
Quick question- does it have an impact if we enable 'Windows Integrated Authentication' on any existing set up as anonymous access is disabled Thanks |
|
#12
|
||||
|
||||
|
Quote:
It would depend upon your circumstances and the nature of the application but as far as I am aware, the only way you can grab the Windows login is via the Request.ServerVariables collection which will not work with anonymous access enabled. Therefore, if you need to grab the NT Logon you would need WIA enabled. With regards your existing setup, it would mean that users who are not authenticated correctly against your domain would not be able to access your application. |
|
#13
|
|||
|
|||
|
Quote:
====== I am using LOGON_USER across pages but the value seems to be getting lost for some reason Page1 on submit goes to Page 2 which caputes LOGON_USER & on submit passes it to Page 3 If however,I use the Explorer's back arrow & go back to page 1, and then navigate to page2->page3, the value of LOGON_USER is not getting forwarded. It appears as spaces... Ny clues??? Username is capturing the LOGON_USER in the code below This is how Im passing the value: [Code] <form method=post name="Test" action="Page3.asp"> <input type=hidden name=Username value=<% =Username %> > <input type='submit' name='submit' value='Next'> |
|
#14
|
||||
|
||||
|
If you always want the value of Username to be the value of Request.ServerVariables("LOGON_USER") then why bother saving it to a variable, why not just grab the value of LOGON_USER on the final page. Alternatively, just save the value of LOGON_USER in a session variable on your first page, you can then access this on any page.
Code:
Session("Username") = Request.ServerVariables("LOGON_USER")
|
|
#15
|
|||
|
|||
|
Quote:
-------- Hmmm so to clarify it will be Dim Username Session("Username") = Request.ServerVariables("LOGON_USER") and if I use a form variable(as Im required to do so) & submit it to the next page,moving backwards or forwards it will retain its value?? |
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > VBScript - General - Question - NT Logon |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|