Last post Nov 26, 2009 03:27 PM by mdivk
Nov 26, 2009 03:27 PM|mdivk|LINK
We have multiple domains, all trust each other. I need a way to search for user in all of the domains, how can I do this?
I have code like:
Dim de As System.DirectoryServices.DirectoryEntry
de = New DirectoryEntry("LDAP://snb.snb")
Dim result As SearchResult
searcher = New DirectorySearcher()
searcher.SearchRoot = de
I can't find the user I want to search for.
However, I tried using Administrative Tools -> Active Directory Users and Computers, I am able to find that user in the specified domain. I would assume this means I don't need any extra credential to do the search, right?
Using the same code, I am able to search user in the domain where I am in. So I would think there is some problem in my code for searching in a different domain.
I know there are multiple domain controllers in either domain, I have the list of domain controllers' computer name, like: xxxx.snb.snb, yyyy.snb.snb. My own domain's name is snc.snc, it also has lots of domain contollers, in my test, I don't need to specify
which domain controller to search, just:
de = New DirectoryEntry("LDAP://snc.snc")
Can anyway tell me why I don't get any match result when search another domain? Any suggestion or any working sample? thank you very much.