Click here to Skip to main content
15,886,055 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

Any idea how can I display the forest and its subforest in Active Directory to a combo box using c#?

Any help would be appreciated.

What I have tried:

Hi guys,

Any idea how can I display the forest and its subforest in Active Directory to a combo box using c#?

Any help would be appreciated.
Posted
Updated 19-Mar-23 4:24am
v2

cdata has commercial drivers for various data stores that plug into visual studio, AD being one of them.
I wanted recently to read and write google calendars and was investigating just how I might when I found a link to the cdata site. This could save me months.

I just got started with it, so I can offer no support other than this.
Active Directory ODBC Driver: ODBC Driver for Active Directory - CData Software[^]
 
Share this answer
 
The System.DirectoryServices namespace in .net has classes for using Active Directory via LDAP.
I use it quite a bit, maybe I need to post a tip about it.

Some specifics will depend on what types of objects you request.

Basically:
You instantiate a DirectoryEntry
And a DirectorySearcher
  Set the Filter property
  If you expect more than 1000 objects, set PageSize and SizeLimit to 1000
  You may also want to set CacheResults to false
  SearchScope defaults to Subtree
  Consider setting Asynchronous to true ( I have to try that myself)
Then call FindAll
And iterate through the SearchResultCollection

What you do with the data is up to you.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900