I'm trying to write an efficient LDAP Query that returns results from another Forest/Domain. There is not a two-way trust in place. There are not conditional forwarders in place. What I do have is a verified network connection, an IP address and a service account and password to use.
This is the basic LDAP code I usually use.
DirectoryEntry deParent = new DirectoryEntry("LDAPS://000.0.000.00/DC=bob,DC=earl,DC=john,DC=whatever");
deParent.Username = "Domain\\UserName";
deParent.Password = "Password";
deParent.AuthenticationType = AuthenticationTypes.Secure;
DirectorySearcher ds = new DirectorySearcher(deParent, qry, columns, SearchScope.Subtree);
I know this is a little broad spectrum, but there's a lot of conflicting information out there. So.
- Is a trust REQUIRED to perform a cross forest query? Query only, no login except for the service account.
- Will a basic DirectoryEntry call like above work?
- Can anyone please provide an example of a working cross forest query in c#?