Enumerating all available objectClass?
- From: "Homer J. Simpson" <root@xxxxxxxxx>
- Date: Wed, 9 Jan 2008 10:48:33 -0500
Hi all,
I'm new to AD querying (and AD itself, actually). I'm working in C#/.NET
2.0.
I need to enumerate all the available object classes defined in a given
domain. I'll use this list to fill a dropdown; when a selection is made,
I'll fill another list that only contains items that have the selected
value.
I can do this right now with the following:
string strDomain = "mydomainname";
System.DirectoryServices.DirectoryEntry entry = new
System.DirectoryServices.DirectoryEntry( "LDAP://" + strDomain );
System.DirectoryServices.DirectorySearcher mySearcher = new
System.DirectoryServices.DirectorySearcher( entry );
mySearcher.Filter = "(objectClass=*)";
foreach( System.DirectoryServices.SearchResult resEnt in
mySearcher.FindAll() ) {
[...]
}
I can then build a list of objectClass'es as I iterate over the items
returned and look at their properties.
This works fine for a tiny domain, but obviously it's the completely wrong
approach, and will be unacceptably slow for a medium-sized one.
What's the accepted way of quickly retrieving all object classes currently
defined in the entire AD, so I can limit subsequent queries to
"(objectClass=[chosen class]")?
.
- Follow-Ups:
- Re: Enumerating all available objectClass?
- From: Joe Kaplan
- Re: Enumerating all available objectClass?
- Prev by Date: Incompatible schema
- Next by Date: Re: Logon problem
- Previous by thread: Incompatible schema
- Next by thread: Re: Enumerating all available objectClass?
- Index(es):