我有以下代码:
var directoryEntry = new DirectoryEntry(distributionListsListADSPath);
var directorySearcher = new DirectorySearcher(directoryEntry)
{ SizeLimit = int.MaxValue, PageSize = int.MaxValue };
var result = directorySearcher.FindAll();
问题是我想搜索两个单独的 OU。
所以我所做的就是运行两次,一次在哪里
private const string distributionListsListADSPath =
"LDAP://OU=Distribution Lists,OU=Groups,DC=enron,DC=com";
还有一秒钟
private const string distributionListsListADSPath =
"LDAP://OU=Security Groups,OU=Groups,DC=enron,DC=com";
理想情况下,我可以做类似的事情
private const string distributionListsListADSPath =
"LDAP://OU=Distribution Lists | OU = Security Groups ,OU=Groups,DC=enron,DC=com";