Get Information like real username from AD

From: VK (VK_at_discussions.microsoft.com)
Date: 05/26/05

  • Next message: Jim: "Windows Authentication not working after publishing asp.net to IIS"
    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


  • Next message: Jim: "Windows Authentication not working after publishing asp.net to IIS"

    Relevant Pages

    • RE: LDAP + Active Directory
      ... Subject: LDAP + Active Directory ... LDAP uses an anonymous access for reading the tree, ... This list is provided by the SecurityFocus Security Intelligence Alert ... For more information on SecurityFocus' SIA service which ...
      (Pen-Test)
    • RE: LDAP + Active Directory
      ... Subject: LDAP + Active Directory ... LDAP server on it's rootdse. ... This list is provided by the SecurityFocus Security Intelligence Alert ...
      (Pen-Test)
    • Re: domain name/LDAP redundancy
      ... The app currently contacts one of the DC's for the LDAP search however, ... uses ADO to retrieve the Distinguished Names of all users in the domain. ... adoConnection.Open "Active Directory Provider" ...
      (microsoft.public.windows.server.active_directory)
    • RE: LDAP + Active Directory
      ... Subject: LDAP + Active Directory ... current article series on Sfocus (An Audit of Active Directory Security)... ... that security in AD can get ... For more information on SecurityFocus' SIA service which ...
      (Pen-Test)
    • Re: Active directory (LDAP) name has changed itself for no reason
      ... Since yesterday morning, apparently without any cause, the LDAP name ... Netbios name of the domain is different from the active directory ... name is listed as ERPSOURCING; also the Netbios name is ERPSOURCING. ...
      (microsoft.public.windows.server.active_directory)