我需要特定组的所有电子邮件地址。请帮我
string filter1 = string.Format("(&(objectClass=group)(cn={0}))", "groupname");
DirectorySearcher searcher = new DirectorySearcher(entry);
searcher.Filter = filter1;
searcher.SearchScope = SearchScope.Subtree;
searcher.PropertiesToLoad.Add("member");
SearchResult res = searcher.FindOne();
ArrayList userNames = new ArrayList();
if (res != null)
{
for (int counter = 0; counter <res.Properties["member"].Count; counter++)
{
string user = (string)res.Properties["member"][counter];
userNames.Add(user);
}
}
我收到用户名和其他详细信息,但没有收到电子邮件。请告诉我直接找到每个用户的电子邮件地址的方法。