ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 2nd, 2009, 03:19 PM
newtoasp_pk newtoasp_pk is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 116 newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 1 h 1 m 3 sec
Reputation Power: 2
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

Reply With Quote
  #2  
Old July 2nd, 2009, 03:52 PM
lookout888 lookout888 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 2 lookout888 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 56 sec
Reputation Power: 0
Name = Request.ServerVariables("LOGON_USER")

This will tell you who is logged onto the computer.

Reply With Quote
  #3  
Old July 3rd, 2009, 02:49 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,632 sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 3 Days 15 h 14 m 45 sec
Reputation Power: 1909
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.
Comments on this post
Nilpo agrees!

Reply With Quote
  #4  
Old July 3rd, 2009, 03:05 AM
newtoasp_pk newtoasp_pk is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 116 newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 1 h 1 m 3 sec
Reputation Power: 2
Quote:
Originally Posted by lookout888
Name = Request.ServerVariables("LOGON_USER")

This will tell you who is logged onto the computer.


Hi,


Neither

Username = Request.ServerVariables("LOGON_USER")
nor
Username = Request.ServerVariables("AUTH_USER")

are working.

Any other wayout?
Thanks

Reply With Quote
  #5  
Old July 3rd, 2009, 03:07 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,632 sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 3 Days 15 h 14 m 45 sec
Reputation Power: 1909
Quote:
Originally Posted by newtoasp_pk
Hi,


Neither

Username = Request.ServerVariables("LOGON_USER")
nor
Username = Request.ServerVariables("AUTH_USER")

are working.

Any other wayout?
Thanks

Have you enabled Windows Integrated Authentication?

Reply With Quote
  #6  
Old July 3rd, 2009, 03:14 AM
newtoasp_pk newtoasp_pk is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 116 newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 1 h 1 m 3 sec
Reputation Power: 2
Quote:
Originally Posted by sync_or_swim
Have you enabled Windows Integrated Authentication?


Yes, authentication is enabled

Reply With Quote
  #7  
Old July 3rd, 2009, 03:18 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,632 sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 3 Days 15 h 14 m 45 sec
Reputation Power: 1909
Quote:
Originally Posted by newtoasp_pk
Yes, authentication is enabled

And anonymous access is disabled in IIS?

Reply With Quote
  #8  
Old July 3rd, 2009, 03:24 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,632 sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 3 Days 15 h 14 m 45 sec
Reputation Power: 1909
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>

Reply With Quote
  #9  
Old July 3rd, 2009, 03:25 AM
newtoasp_pk newtoasp_pk is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 116 newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 1 h 1 m 3 sec
Reputation Power: 2
Quote:
Originally Posted by sync_or_swim
And anonymous access is disabled in IIS?


----------

Hi,

Thanks
Its working now. I was checking at the wrong server.

Thanks

Reply With Quote
  #10  
Old July 3rd, 2009, 03:29 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,632 sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 3 Days 15 h 14 m 45 sec
Reputation Power: 1909
Quote:
Originally Posted by newtoasp_pk
----------

Hi,

Thanks
Its working now. I was checking at the wrong server.

Thanks

LOL!! You're welcome, glad you got it working!!

Reply With Quote
  #11  
Old July 3rd, 2009, 03:36 AM
newtoasp_pk newtoasp_pk is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 116 newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 1 h 1 m 3 sec
Reputation Power: 2
Quote:
Originally Posted by sync_or_swim
LOL!! You're welcome, glad you got it working!!



Quick question- does it have an impact if we enable 'Windows Integrated Authentication' on any existing set up as anonymous access is disabled

Thanks

Reply With Quote
  #12  
Old July 3rd, 2009, 03:43 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,632 sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 3 Days 15 h 14 m 45 sec
Reputation Power: 1909
Quote:
Originally Posted by newtoasp_pk
Quick question- does it have an impact if we enable 'Windows Integrated Authentication' on any existing set up as anonymous access is disabled

Thanks

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.

Reply With Quote
  #13  
Old July 7th, 2009, 04:39 PM
newtoasp_pk newtoasp_pk is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 116 newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 1 h 1 m 3 sec
Reputation Power: 2
Quote:
Originally Posted by sync_or_swim
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.

======

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'>

Reply With Quote
  #14  
Old July 8th, 2009, 02:46 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Moderator
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 3,632 sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level)sync_or_swim User rank is General 14th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 3 Days 15 h 14 m 45 sec
Reputation Power: 1909
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")

Reply With Quote
  #15  
Old July 8th, 2009, 05:22 AM
newtoasp_pk newtoasp_pk is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2009
Posts: 116 newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level)newtoasp_pk User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 1 h 1 m 3 sec
Reputation Power: 2
Quote:
Originally Posted by sync_or_swim
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")

--------
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??

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > VBScript - General - Question - NT Logon


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 7 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek