473,386 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Active Directory and LDAP

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

Nov 17 '05 #1
4 12158
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" <Co*******@discussions.microsoft.com> wrote in message
news:1F**********************************@microsof t.com...
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


Nov 17 '05 #2
>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
Nov 17 '05 #3
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
Nov 17 '05 #4
>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
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Victor Lokhmatov | last post by:
Hello Everyone, My company has asked me to put a company directory on our intranet site and I'm trying to use php to extract the users from our active directory server. I've got everything...
1
by: Harlin Seritt | last post by:
Does anyone know if there are any Python Active Directory Modules out there? I looked at LDAP module but there is no version for Python 2.4 and it's support for Active Directory seems to be lacking...
0
by: microsoft | last post by:
Hi People, when I try to modify an active directory user programatically, I receive the following exception: The server is unwilling to process the request Reading the microsoft web site, I...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
12
by: JIM.H. | last post by:
Hello, Here is my code that I got from internet and I am assuming this give me e-mail address of the people in the active directory. Private Sub Page_Load(ByVal sender As System.Object, ByVal e...
0
by: RTT | last post by:
here is my current situation. I develop a program on my computer's localhost. From there i contact Active directory succesfull using a connectionstring like:...
2
by: Jim in Arizona | last post by:
My goal, somehow, is to populate a dropdownlist with all the user names in active directory. I don't even know where to begin, really. I added a reference to System.DirectoryServices so I could...
0
by: Chung Leong | last post by:
In this brief tutorial I'll describe how you retrieve information from an Active Directory through the OLE-DB extension. While it is possible to use the LDAP extension to achieve the same goal, as...
1
by: mfsiddiq | last post by:
HI i am trying to connect my java client to Microsoft active directoy using secure ssl,but when i try enable ssl support i get the following error but it works fine with apache studio,which is a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.