List of all users in active directory

bignate

Registered User.
Local time
Today, 07:06
Joined
Aug 28, 2013
Messages
34
Hi

I would like to get a list of all the users in the active directory and put them in a combo box. Does anyone know how to do this?
I would like it to show there CN name

Thanks
 
Yeah I have tried them and they either don't work or I am doing something wrong.

Thanks anyway
 
Return a Recordset with the info you want to display then Set the Recordset property of the combo to it.

BTW I have posted on a number of threads about LDAP at this site.

Google:
Galaxiom LDAP site:www.access-programmers.co.uk
 
Galaxiom I don't know how to get the names of all the users though. I just rad your threads now and I do understand LDAP a bit better now but I don't know enough to get a list of all the users.

Thanks
 
Demo Attached.

It uses a disconnected ADODB recordset as the combo recordset.

Late Binding so it doesn't require reference to ActiveX.
 

Attachments

Thank you that is what I wanted.

The only problem is that I want to filter the results because it showed some suers that I didnt expect to show up. I know I would have to do this with the SQL
To try and fix this I will filter the results that show by department so I went into the active directory and saw that each department is in an Accounts category so I tried to do what is below but it does not work because I most likely have the wrong syntax for choosing a department

WHERE objectAccounts='DepartmentName'

and then I would like it to only show active user accounts but im not sure how I would reference that either.
 
The users' AD Group Membership can be determined too but it is a considerably more complex. I think Groups have a multivalue field with membership so it returns an array. I have the code for doing this somewhere.

Meanwhile check out this page for potential simple sorting fields. These are just the User attributes and that is just one part of AD.
 
BTW One of the really nice things about using disconnected ADO recordsets for listboxes and combos is the ability to use the Filter and Sort Methods within the recordset itself without hitting the database again.

You can't do this with a conventional RowSource and because they live just in RAM they are blisteringly fast.

Fabricated ADO recordsets are even more versatile. The data can be put together from absolutely anything without even touching a database engine.
 
It turns out finding the department is as simple as:
WHERE department='DepartmentName'
Its weird though because for some departments it shows some of the users whose accounts are inactive but not every inactive account.

Thanks for the link because I found out how to filter by department from there. Also thanks for the tips
 

Users who are viewing this thread

Back
Top Bottom