Active Directory

G

Galore

Hello,

I need to get all the AD information from a user that access a intranet
ASP.NET page.Does anyone can tell me how to do it? (the user can't put its
login and password on a text box and validate it, I've got to get it by
code)

Thanks
 
B

Beginner

You can have one resource account that has AD query previlige and something
like

DirecotryEntry entry = new DirectoryEntry(path, username, password)
 
G

Galore

Thanks for your reply, but the main problem is not get information from AD,
it's how can I know which user has accessed the ASP.NET page.

[]'s
 
B

bzhang

You can use Request.ServerVariables["logon_user"], but there're no guarantee
that it will give you the result all the time. Espeically if you have
non-domain or non-window users.

Galore said:
Thanks for your reply, but the main problem is not get information from AD,
it's how can I know which user has accessed the ASP.NET page.

[]'s

Beginner said:
You can have one resource account that has AD query previlige and something
like

DirecotryEntry entry = new DirectoryEntry(path, username, password)
 
E

eRic

To get the user name you need to turn off anonymous access on the site. IIS will then request the user's credentials.
At that point you can use the Context.User object and get stuff like .Identity.Name

- eZe
 
G

Guest

If your AD allows to read data for anonymous users such as default iis user
when you have to turn off anonymous access and turn on Windows
Authentication only in website properties

But in many cases w/o impersonation it is not possible to get data from AD.
Either to turn on impersonation (in web.config) or to use a COM-component,
which could be executed with account of an user who has rights read AD


eRic said:
To get the user name you need to turn off anonymous access on the site.
IIS will then request the user's credentials.
 
G

Galore

Hmm, thanks all, I'll try these sugestions

Anon User said:
If your AD allows to read data for anonymous users such as default iis user
when you have to turn off anonymous access and turn on Windows
Authentication only in website properties

But in many cases w/o impersonation it is not possible to get data from AD.
Either to turn on impersonation (in web.config) or to use a COM-component,
which could be executed with account of an user who has rights read AD



IIS will then request the user's credentials.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,136
Messages
2,570,797
Members
47,346
Latest member
Jason Calder

Latest Threads

Top