Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get user name, email, etc from AD?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01420727
Message ID:
01421938
Vues:
35
>>Hi,
>>
>>Is there a class that I can use to get info on the current user (browsing my page) from the Active Directory?
>
>Take a look at DirectoryEntry and DirectorySearcher in the System.DirectoryServices namespace. If you're under 3.5, there is also the ActiveDirectory and AccountManagement classes now available. In order to be able to get the information about the current user you need to know how to map the logged in user to AD. That means you either need to be using Windows authentication with your webpage, or have some way of associating the logged in user with a specific user account in AD (for example, you might just use the same username in both places).

Paul,

I hope you don't mind if I ask you your opinion (I don't expect you to know all the answers for me <g>). I found a nice article on using System.DirectoryServices, as you kindly suggested. But when I try to enter "using System.Dir..." in my ASP.NET page the intellisense does not pick it up. Do you think this is because I don't actually have AD on my notebook and .NET "knows" it?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform