title: Reading username and emailid of members under outlook distribution list using C#
body: <p>I want to fetch username and email id of all users under particular Distribution List from outlook.</p>
  
  <p>I have the below code.</p>
  
  <pre><code>                DirectorySearcher search;
                  DirectoryEntry entry;
  
                  entry = new DirectoryEntry("LDAP://" + Domain);
                  search = new DirectorySearcher(entry);
                  search.Filter = "(&amp;(objectClass=Distribution Lists) (CN=" + distList + "))";
  
                  //search.Filter = "CN=" + distList;
                  //search.Filter = "cn=" + distList + ",ou=Distribution Lists,dc=bosch,dc=com";
                  //search.Filter = "cn=" + distList + ",ou=Distribution Lists";
                  int i = search.Filter.Length;
  
  
                  string str = "", str1 = "";
                  foreach (SearchResult AdObj in search.FindAll())
                  {
  
  
                      foreach (String objName in                  AdObj.GetDirectoryEntry().Properties["member"])
                      {
                          COnsole.writeline(objName);
  }
  }
  </code></pre>
  
  <p>'FindAll' method is not able to fetch anything. </p>
  
  <p>Is there anything wrong with my code??</p>
  
  <p>CAn some one give me sample code which can fetch username and email Id of all users under Distribution List??</p>
  
  <p>Any help is appreciated.</p>
  
  <p>Thank you in advance!!</p>