Get Information like real username from AD
From: VK (VK_at_discussions.microsoft.com)
Date: 05/26/05
- Previous message: VK: "How to get LDAP directory server"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 26 May 2005 11:55:04 -0700
Hello,
I am trying to get the real name of the user from the Active directory via
LDAP. However it always returns me the userid, which he uses to login.
Furthermore, I would also like to retrieve additional information - i.e what
role the user has + phonenr, email etc... Here is the code I used:
Dim entry As DirectoryEntry = New DirectoryEntry("LDAP://...",
"domain\user", "userpw")
Dim mySearcher As System.DirectoryServices.DirectorySearcher = New
System.DirectoryServices.DirectorySearcher(entry)
mySearcher.Filter = ("(sAMAccountName=user)")
Response.Write("===========================================<br>")
For Each resEnt As System.DirectoryServices.SearchResult In
mySearcher.FindAll
Response.Write(resEnt.GetDirectoryEntry.Name.ToString & "<br>")
Response.Write("===========================================" & "<br>")
Next
- Previous message: VK: "How to get LDAP directory server"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|