Link to home
Start Free TrialLog in
Avatar of hamood
hamood

asked on

Getting domains, users and groups from Active Dir using LDAP

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
Avatar of mladenovicz
mladenovicz

Avatar of hamood

ASKER

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
try something like this to get domains

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

Next
SOLUTION
Avatar of mladenovicz
mladenovicz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Set objWinNT = GetObject("WinNT:")
For Each objDomain In objWinNT
   Debug.Print objDomain.Name
Next
SOLUTION
Avatar of hes
hes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hamood

ASKER

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
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial