title: How to get all the properties from a DirectoryEntry object
body: <p>I try to write a procedure which fetches all the properties in an available <code>DirectoryEntry</code></p>
  
  <pre><code>// create LDAP connection object  
  
  DirectoryEntry myLdapConnection = createDirectoryEntry();  
  
  // create search object which operates on LDAP connection object  
  // and set search object to only find the user specified  
  
  DirectorySearcher search = new DirectorySearcher(myLdapConnection);  
  search.Filter = "(cn=" + username + ")";  
  
  // create results objects from search object  
  
  SearchResult result = search.FindOne();  
  
  if (result != null)  
  {  
      // user exists, cycle through LDAP fields (cn, telephonenumber etc.)  
  
      ResultPropertyCollection fields = result.Properties;  
  
      foreach (String ldapField in fields.PropertyNames)  
      {  
           // cycle through objects in each field e.g. group membership  
           // (for many fields there will only be one object such as name)  
  
           foreach (Object myCollection in fields[ldapField])   
               Console.WriteLine(String.Format("{0,-20} : {1}",   
                      ldapField, myCollection.ToString()));  
      }  
   }  
  
   else  
   {  
        // user does not exist  
        Console.WriteLine("User not found!");  
   }
  </code></pre>
  
  <p>When I Try to execute this procedure under one user, it returns me a list of properties but when I try to execute this procedure under a different user it returns me a different number of properties. </p>
  
  <p>What kind of authorization do I need in order to get <strong><em>all</em></strong> of the properties?</p>
  
  <p>Thanks in advance</p>
  
  <p>Kobi</p>