Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Getting domains, users and groups from Active Dir using LDAP

Posted on 2004-09-01
9
Medium Priority
?
488 Views
Last Modified: 2012-06-22
I am trying to get different domains, their groups and users in groups from active directory server using LDAP. First of all I have to populate the listing of all the groups and their domains from active dir in combo box,  now user can select any group from this combo. As soon as user selects this group all the user belonging to this group will be displayed in datagrid with thier attributes like first name, last name, email, address, phone from active dir.
Any help in this regard would be appriciated.
I have tried to used the Active DS Type library in VB6 and successfully implemented the above functionality but i want generic solution using LDAP.  

Is there any way to get default domain using Active DS Type library?

Hamood
0
Comment
Question by:hamood
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 8

Expert Comment

by:mladenovicz
ID: 11953532
0
 
LVL 4

Author Comment

by:hamood
ID: 11953678
I have checked this but it is not what i needed. I want to get all domains first then after selecting any domain i will get all its groups and when any one selects any groups all its user should be displayed with their attributes in the grid. Actually i need to get displayed all the existing domains, groups and users in active dir but every thing depends on the next one
0
 
LVL 8

Expert Comment

by:mladenovicz
ID: 11953740
try something like this to get domains

Set objWinNT = GetObject("WinNT:")
For Each objDomain In objWinNT

Next
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 8

Assisted Solution

by:mladenovicz
mladenovicz earned 200 total points
ID: 11953804
Oops, I forgot one lin

Set objWinNT = GetObject("WinNT:")
For Each objDomain In objWinNT
   Response.Write objDomain.Name
Next
0
 
LVL 8

Expert Comment

by:mladenovicz
ID: 11953860
Set objWinNT = GetObject("WinNT:")
For Each objDomain In objWinNT
   Debug.Print objDomain.Name
Next
0
 
LVL 20

Assisted Solution

by:hes
hes earned 200 total points
ID: 11954940
Check out the excellent example here :

http://www.freevbcode.com/ShowCode.Asp?ID=1896
0
 
LVL 4

Author Comment

by:hamood
ID: 11961098
hes
thanx I have already checked the example at the location and currenty i am using the same technique. But I have to do the things using LDAP because this example uses ADTS library.

mladenovicz
Thanx for the code. I am already using this type of code to get domains but i have to do the things using LDAP. I need a favour in ADTS library for getting default domain of the Active Dir. I would appriciate if you could help me in this regards

Thanx
Hamood
0
 
LVL 12

Accepted Solution

by:
jkaios earned 400 total points
ID: 12006892
Hamood, try this one:

 Dim oRoot, oDomain, sDomain
 
 Set oRoot = GetObject("LDAP://rootDSE")
 sDomain = oRoot.Get("defaultNamingContext")
 Set oDomain = GetObject("LDAP://" & sDomain)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question