Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User Logon Info - VERY URGENT! 1

Status
Not open for further replies.

samosa

Technical User
Jul 15, 2005
38
IT
Dear gurus!
When an employee logs on to our intranet site, I need to capture his/her username.
Can you please tell me how to do this?
A script would be great.
This is very urgent, please help!!!
 
What are you using to allow them to logon? ASP page, Default NT logon, Client side script...?
Do you want this stored in a database, text file, fortune cookie...?

The more specific the better we can anser :)
-tarwn ------------ My Little Dictionary ---------
Reverse Engineering - The expensive solution to not paying for proper documentation
 
Tarwn, thanks for your response.
The employees will be logging in with their system Ids (windows xp).
I just need to find a way to capture their username after they login.
I probably will prefer to store it in a textfile.
thx,
 
If you want there Windows login name use this:

UserName= (Request.ServerVariables("LOGON_USER")

This will give you DomainName/LoginName

If you want there actual name you'll need to register the active directory services interface dll on your web server. You can download it from Microsoft if it isn't already registered.

Then you can get there name using this:

UserName= Replace(Request.ServerVariables("LOGON_USER"),"\","/")
set User = GetObject("WinNT://" & UserName)
strmyfullName = User.FullName

strmyfullName will now contain (example) "Smith, John"
 
when I put this code at the top of my asp code,
how do I know that it is doing what it is supposed to do?
Thanks in advance!!

<%
'------------------------------------------
' Get the USERNAME from the environment
'------------------------------------------
dim s_username
s_username = Request.ServerVariables(&quot;LOGON_USER&quot;)
%>


 
write it
response.write s_username
to test Not everything you type is understanding to others! Think about that before getting upset with a wrong answer to your question.

admin@onpntwebdesigns.com
 
onpnt, I am sorry if I sounded upset.
I was NOT upset when I sent the thread.
I can't be upset when I am asking folks like you to help me.
Further, I have been getting pretty fast and accurate responses from you guys so I was not upset at all.
I wasn't even frustrated.
 
samosa, that wasn't meant towards you. it's a signature. [lol]

I think I need to take hat one off Not everything you type is understanding to others! Think about that before getting upset with a wrong answer to your question.

admin@onpntwebdesigns.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top