473,770 Members | 6,158 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12180
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*******@disc ussions.microso ft.com> wrote in message
news:1F******** *************** ***********@mic rosoft.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.Director yServices 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=Pare ntOU,dc=YourCOm pany,dc=com");

// enumerate children
foreach(Directo ryEntry deChild in deMyOU.Children )
{
if(deChild.Sche maClassname == "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.publi c.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=Yo urCOmpany,dc=co m

and you're done.

You might get more and more focussed answers in

microsoft.publi c.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
5528
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 working, however, when the list of users is shown in the output, it seems to display the users in the order their accounts were created, with Administrator obviously being first. What do you think would be the best way to get the list to be sorted by...
1
2071
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 a bit. Thanks, Harlin Seritt
0
2785
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 found this article: http://support.microsoft.com/default.aspx?scid=kb;EN-US;248717 that says the following: ..........................
1
4755
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 I have run into I am not sure how to fix, and really not sure what is causing it. Here's what is going on (test server - Windows 2003 Server): I have a page in a folder (under anonymous authentication in IIS6) that has a link on it that...
12
1557
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 As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here Dim rootEntry As New DirectoryEntry("GC://dc=oecc,dc=net") Dim searcher As New DirectorySearcher(rootEntry) searcher.PropertiesToLoad.Add("mail")
0
2033
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: LDAP://OU=BE,OU=SE,DC=eu,DC=aagp,DC=corp. This works fine. My computer is in and OU under the BE folder, and so is my User. I have no problems connecting to the Active Directory. But now that my code is finished i want to put it online on one of the company servers. but when i...
2
5984
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 use the System.DirectoryServices.ActiveDirectory namespace. I don't even know if this is the right way to go as I can't seem to find anything in that namespace that would help me query active directory for names. I can't use an LDAP query...
0
5415
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 you will see using Microsoft's OLE-DB provider is much easier. You will need to download and install the OLE-DB extension. Here's the location once again: http://sourceforge.net/project/showfiles.php?group_id=171247&package_id=198554. See my...
1
4218
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 ldap browser and i am able to view the ldap tree.But when i use the same configuration with my java client the following exception is thrown 0:03:19,296 ERROR crowd.console.action.principal.BrowsePrincipals: Unable to communicate with LDAP server;...
0
9592
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10231
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10059
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6679
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.