If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Display NT User Name in ASP

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-17-05, 06:13
donaldt donaldt is offline
Registered User
 
Join Date: Jan 2002
Location: Nottingham - UK
Posts: 113
Display NT User Name in ASP

Hi Folks

Im user II6 & a Windows NT Domain

I'm just looking for a way to display the username on page of the client access the site.

Is this possible, I have had a search but cant find anything that help...

Hope you can.

Regards

Donald
Reply With Quote
  #2 (permalink)  
Old 11-18-05, 15:29
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
I believe it's passed as one of the server variables... providing IIS is configured to request it of course... think it is one of these two...
Code:
Request.ServerVariables("REMOTE_USER")
Request.ServerVariables("AUTH_USER")
It won't work well over the internet but through an intranet it is generally pretty good.
Reply With Quote
  #3 (permalink)  
Old 12-01-05, 15:25
pramsey pramsey is offline
Registered User
 
Join Date: Nov 2005
Posts: 20
I've seen this code on various sites, but I never got it to work. I found it on 4guysfromrolla or a site similar to it.
Code:
'Store the NT LOGON name minus the doamin name in a session variable
LN = Request.ServerVariables("REMOTE_USER")
Session("NTLogon") = UCase(Right(LN, Len(LN) - InStr(1, LN, "\")))
__________________
Programming/Web Design
http://eofficeprofessionals.com/forums

Offer solutions-not criticism.
Reply With Quote
  #4 (permalink)  
Old 12-01-05, 17:51
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
It all depends on the security settings you have in IIS. I think you need to disable anonymous access,... I can't remember though as I haven't used it in ages.
Reply With Quote
  #5 (permalink)  
Old 12-05-05, 09:55
ImageMage ImageMage is offline
Registered User
 
Join Date: Mar 2005
Posts: 94
Yes anonymous access must be unchecked within the IIS manager, as well as yes you guessed it, they must be logged in. Now it will also store the domain in the username if your IIS server manages more then 1 domain.

I do believe also that the remote user is the option your going to want to go with.
__________________
ImageMage

Access 2003, Dreamweaver MX 2k4, and everything else work piles on me

Aspiring NEWB
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On