I have the following code:
var directoryEntry = new DirectoryEntry(distributionListsListADSPath);
var directorySearcher = new DirectorySearcher(directoryEntry)
{ SizeLimit = int.MaxValue, PageSize = int.MaxValue };
var result = directorySearcher.FindAll();
The problem is I want to search two seperate OUs.
So what I do is run through this twice, once where
private const string distributionListsListADSPath =
"LDAP://OU=Distribution Lists,OU=Groups,DC=enron,DC=com";
and a second where it is
private const string distributionListsListADSPath =
"LDAP://OU=Security Groups,OU=Groups,DC=enron,DC=com";
Ideally, I could do something like
private const string distributionListsListADSPath =
"LDAP://OU=Distribution Lists | OU = Security Groups ,OU=Groups,DC=enron,DC=com";