
May 10th, 2007, 10:33 AM
|
|
Registered User
|
|
Join Date: May 2007
Posts: 1
Time spent in forums: 14 m 36 sec
Reputation Power: 0
|
|
Find Multi Domain
I am using a C# System.DirectoryServices assembly to sniff out all domains listed under LDAP.
So first I create a DirectorySearcher with the correct "LDAP://RootDSE" entry.
Then I call the FindAll() method.
See Snippet:
DirectorySearcher directorySearcher = new DirectorySearcher(new DirectoryEntry("LDAP://RootDSE"));
SearchResultCollection results = directorySearcher.FindAll();
foreach (SearchResult searchResult in results)
{
Console.WriteLine(searchResult.Path);
}
The problem is I always get only ONE returned SearchResult!
The IT guys tell me I should be able to see two results.
Does anyone have a script or snippet which works for them?
Is my snippet totally off the mark?
Any help will be greatly appreciated
-c
|