KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am working on an C# and ASP.Net application, that uses Windows Authentication. i.e. in Web.config: <system.web> <authentication mode="Windows" /> </system.web> I want to get details for the current user (full name, email address, etc) from Active Directory. I can get their pre Windows 2000 user login name (eg: SOMEDOMAIN\someuser ) by using string username = HttpContext.Current.Request.ServerVariables["AUTH_USER"]; I've worked out the LDAP query for the user, using their current login name (not their pre Windows 2000 user login name): DirectorySearcher adSearch = new DirectorySearcher( "(userprincipalname=someuser@somedomain.com.au)"); SearchResult adSearchResult = adSearch.FindOne(); However, I don't know how to either search AD for the user using their pre W2K login name, or get their login name in the 'someuser@somedomain.com.au' format. Any ideas?
Tags (comma-separated)
Save Edits
Cancel