473,379 Members | 1,253 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Querying AD for a user's log-in name...

Is it possible to retrieve a user's log-in name from AD when they
visit a particular website? I'm wanting to store exactly who clicked
on certain links and when they clicked them. Is this possible? I
know very little about AD, so any help would be appreciated. Thanks!
:)

Nov 18 '05 #1
3 856
Try Request.ServerVariables("LOGON_USER").

Note that it may not work consistently if you allow anonymous users in IIS.
Here's more info:
http://www.4guysfromrolla.com/webtech/092298-3.shtml

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"ckpicker" <ma**************@yahoo-dot-com.no-spam.invalid> wrote in message
news:40********@127.0.0.1...
Is it possible to retrieve a user's log-in name from AD when they
visit a particular website? I'm wanting to store exactly who clicked
on certain links and when they clicked them. Is this possible? I
know very little about AD, so any help would be appreciated. Thanks!
:)

Nov 18 '05 #2
When you are not using anonymous credentials, the username is passed in the
server variables collection when it is known.

It is normally passed by the browser using passthrough authentication (ntlm)
or basic authentication or an authentication challenge (403 response) is
issued and the user needs to provide valid credentials. It is then checked
behind the scenes by IIS for authentication and if succesful the server
variables collection should now contain the username.

You dont have to talk directly to AD from your code, and what they clicked
will be in the webserver logs.

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
"ckpicker" <ma**************@yahoo-dot-com.no-spam.invalid> wrote in message
news:40********@127.0.0.1...
Is it possible to retrieve a user's log-in name from AD when they
visit a particular website? I'm wanting to store exactly who clicked
on certain links and when they clicked them. Is this possible? I
know very little about AD, so any help would be appreciated. Thanks!
:)

Nov 18 '05 #3
Yes, it is possible. However, it is not necessary. As you already know their
login name (passed by the browser with authentication), you already have a
unique identifier for that user which you can use to store information
specific to that user in the database. Fetching more infomation about them
from Active Directory should not be necessary if all you are doing is
tracking them.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"ckpicker" <ma**************@yahoo-dot-com.no-spam.invalid> wrote in message
news:40********@127.0.0.1...
Is it possible to retrieve a user's log-in name from AD when they
visit a particular website? I'm wanting to store exactly who clicked
on certain links and when they clicked them. Is this possible? I
know very little about AD, so any help would be appreciated. Thanks!
:)

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: radicool | last post by:
What is the User ID and Password for querying Follett's TextLink database. I am using Adaptive Server Anywhere. If this is not the best group to ask this, where would be?
0
by: Sociando | last post by:
Hi, I've a problem for querying an LDAP after a while. I mean that the query method works for a while, and suddenly I've the error, and the only way I found to make it work again is to log off/...
2
by: Vivek Sharma | last post by:
Hi There, I have my menu as a user control. My menu control is dynamic as I am building it on the basis of user rights. Whenever a user logs on the menu control is built with proper access...
7
by: C Jay Pemberton Jr | last post by:
I am attempting to do the following, query indexing services through SQL Server SQL Server 2000/Visual Studio 2003 I have a linked server created called Web_service that points to a Server...
3
by: KarlM | last post by:
I would like to write to the EventLog (Application) with following code. But this works only under admin account. There are no restrictions in the WriteEntry-documentation. Can anyone help me? ...
3
by: ryanf | last post by:
Hello, I want to be able to log if a user is on certain pages for longer than 5 seconds. So if the user goes to the page it starts the timer then if it gets to 5 seconds it will fire off a ajax...
4
by: MMA | last post by:
Hi, How do I extract the IP addresss and the MAC address of the sender of an http request. Thanks in advance
1
by: dwij2u | last post by:
Hi All, Can someone guide me on how we can modify the below script so that no user interaction is required to feed the password when the script is run, current scenario is like if I try to login...
1
by: pushrodengine via AccessMonster.com | last post by:
Is there a way to log user actions? What I would like is to be able to log user activities within the database. The table “tblUserEvents” would contain two fields. Field one “EventTime”...
4
by: =?Utf-8?B?U3VoYXMgVmVuZ2lsYXQ=?= | last post by:
Hello, I am facing an issue while querying Active directory using C# code with system.DirectoryServices namespace. Here is the path for my LDAP - "LDAP://CN=XY - C++/Unix and other,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.