怎么搜索ACTIVE DIRECTORY组底下的成员?
xmchw 2007-03-12 08:27:14 看以下的例子.是我搜索ACTIVE DIRECTORY 组(DI-IT-ITOA)底下成员的方法:
public static void GetAllOU()
{
DirectoryEntry entry = new DirectoryEntry("LDAP://yamani.com.cn");
DirectorySearcher mySearcher = new DirectorySearcher(entry);
// mySearcher.Filter = ("( &(objectClass=user) (objectCategory=Person)(SAMAccountName=cheng.hw)) "); //这个查询成员是对的
mySearcher.Filter = ("( & (objectCategory=group)(objectClass=group)(cn=ITOA))");
foreach(SearchResult resEnt in mySearcher.FindAll()) //这个查询组查不到
{
// resEnt.
MessageBox.Show(resEnt.GetDirectoryEntry().Name.ToString ());
MessageBox.Show(resEnt.GetDirectoryEntry().Parent.Name.ToString());
// resEnt.GetDirectoryEntry().
}//end foreach
}//end GetAllOU
查询不出来.请问各位要怎么查询呢?