>Can i connect to Active Directory with LDAP, without specifying a particular
group?
Yes, of course. Have a look at the System.DirectoryServices namespace.
How can i retrieve a list of groups?
From here? The entire domain? A particular OU in your domain
hierarchy? You need to understand the AD structure (domains / OUs
etc.) in order to get an idea of where to begin.
Have a look at my BeaverTail ADSI Browser - it's C#, it's free, it
comes with full source code, and it will show you your AD structure,
LDAP paths, properties and their values and more.
http://adsi.mvps.org/adsi/CSharp/beavertail.html
If you want to bind to a specific OU and get all its groups, you'd do
something like this:
DirectoryEntry deMyOU = new
DirectoryEntry("LPAP://ou=MyOU,ou=ParentOU,dc=YourCOmpany,dc=com");
// enumerate children
foreach(DirectoryEntry deChild in deMyOU.Children)
{
if(deChild.SchemaClassname == "group")
{
// make a note of that group
}
}
Something like that. The more precise your questions, the more precise
our answers can be!
Also, you might want to scour the microsoft.public.adsi.general
newsgroup for the most competent AD gurus around - that's where you'll
get the best answers the quickest.
Marc
================================================== ==============
Marc Scheuner May The Source Be With You!
Berne, Switzerland m.scheuner -at- inova.ch