PC Review


Reply
Thread Tools Rate Thread

Active Directory and LDAP

 
 
=?Utf-8?B?Q29kZVJhem9y?=
Guest
Posts: n/a
 
      21st Sep 2005
I need to retrieve a list of groups from Active Directory.
Then i need to retrieve a list of users from a group.

I'm unfamiliar with Active Directory objects.

Can i connect to Active Directory with LDAP, without specifying a particular
group?
How can i retrieve a list of groups?

thank you, -- i'm looking for any pointers.

CR



 
Reply With Quote
 
 
 
 
Siva M
Guest
Posts: n/a
 
      21st Sep 2005
These might help you get started:

http://msdn.microsoft.com/library/de...in_a_group.asp

http://msdn.microsoft.com/library/de...in_a_group.asp

http://msdn.microsoft.com/library/de...in_a_group.asp

"CodeRazor" <(E-Mail Removed)> wrote in message
news:1FBD2FD7-7741-49D1-B4A4-(E-Mail Removed)...
I need to retrieve a list of groups from Active Directory.
Then i need to retrieve a list of users from a group.

I'm unfamiliar with Active Directory objects.

Can i connect to Active Directory with LDAP, without specifying a particular
group?
How can i retrieve a list of groups?

thank you, -- i'm looking for any pointers.

CR




 
Reply With Quote
 
Marc Scheuner [MVP ADSI]
Guest
Posts: n/a
 
      22nd Sep 2005
>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
 
Reply With Quote
 
=?Utf-8?B?Q29kZVJhem9y?=
Guest
Posts: n/a
 
      22nd Sep 2005
Hi Marc,

Thank you for your help.

I am trying to retrieve a list of all the groups from Active Directory, so
e.g. (Team Leaders, Accounts, Development etc). ( I am going on the
assumption that email groups are the same as active directory groups....).
I'm working on an Human Resources app that needs to retrieve all groups and
the users that belong to those groups.

Where do I need to connect my DirectoryEntry.Path to in order to retrieve
this information? The server on which active directory is located?, the
domain of my company?

I would be very grateful for your response.

thank you,

CR


 
Reply With Quote
 
Marc Scheuner [MVP ADSI]
Guest
Posts: n/a
 
      25th Sep 2005
>Where do I need to connect my DirectoryEntry.Path to in order to retrieve
>this information? The server on which active directory is located?, the
>domain of my company?


Are you using a rich-client (Winforms app), or a web app (ASP.NET)?

In a rich-client environment, you might not even need to specify the
server to connect to - Windows will know by itself and find the best
server for you. Just specify the full valid LDAP path you want to bind
to, e.g.

LDAP://cn=TeamLeaders,ou=Groups,dc=YourCOmpany,dc=com

and you're done.

You might get more and more focussed answers in

microsoft.public.adsi.general

Cheers!

Marc
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LDAP and Active Directory Sunshine Microsoft Dot NET 0 16th Sep 2008 05:43 PM
[Active Directory] On what ground does LDAP connect to Active Directory RTT Microsoft VB .NET 0 12th Apr 2005 04:20 PM
Moving From Novell LDAP (NLDAP) To Active Directory LDAP =?Utf-8?B?U3RlcGhlbiBNb29yZQ==?= Microsoft Windows 2000 Active Directory 1 27th Apr 2004 12:44 AM
LDAP or active directory? Mike Microsoft VB .NET 3 2nd Feb 2004 04:30 PM
Can you use LDAP and Active Directory as... Microsoft Windows 2000 Active Directory 1 29th Oct 2003 12:12 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:17 PM.