V
VK
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
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