Last post Feb 15, 2008 02:51 PM by raghu1
Feb 14, 2008 06:24 PM|seidensc|LINK
I have an aspx/aspx.cs page that I would like to display a list of users obtained from Active Directory that match my search criteria.
I am using System.DirectoryServices.Protocols to obtain a SearchResponse object (similar to a SearchResultCollection) containing my entries. This is working well but now I would like to display the entries in a repeater control or the like. Could someone
point me to an good example of how this could be done (client and server side code - I'm ASP challenged)? I would think I would need to set up an ObjectDataSource and then populate the items manually.
Any assistance would be greatly appreciated.
Feb 14, 2008 09:37 PM|raghu1|LINK
How about loading an array/DataTable/DataSet while looping thru AD and bind it to repeater ...
Feb 15, 2008 01:27 PM|seidensc|LINK
No disrespect intended but looking back at my original post the key words would be: "Could someone point me to an good example of how this could be done (client and server side code - I'm ASP challenged)?." The part that I am struggling with most is that
ASP is a stateless entity so would I build a DataSet or whatever and then store it in cache? How do I keep track of where a person is as they page through the results?
If someone has an example of building a dataset from scratch that would be helpful. Once the dataset is built I would then bind the repeater control to the dataset; is this correct?
Feb 15, 2008 01:43 PM|raghu1|LINK
In a similar situation, I have built a c# class and added reference to this in the web apps. This way I keep the "n-tier" structure (for maintenance ...reuse ... etc). I dump the AD to a SQL db, this is a scheduled job and I work off the SQL. In our domain
AD is not continuously updated and there other factors for this design. This works very well for me.
Not sure if you have checked DirectoryProgramming.net. I have learnt a lot from this site. There are some good working examples also.
good luck: no disrespect taken.
Feb 15, 2008 02:38 PM|seidensc|LINK
Thank you for your replies Raghu. Yes, I have checked the Directory Programming site out as well. My questions deal more on the ASP side so I posted here.
I like your idea of dumping AD to SQL (it would be a whole lot easier to work with) but we have a lot of activity with our AD as I work in a educational institution and we have students added hourly. I am working on creating a DataTable now. Unfortunately,
the only example I have is VB so I'm struggling a little converting it to C#.
Thanks again for the ideas.
Feb 15, 2008 02:51 PM|raghu1|LINK
Ours is also a university: too many users: temp/students/devices ..... my dump runs Daily and the school administrators are happy[:)]. Depending you your "AD forest" you can dump at a set frequency. My apps takes about 25 minutes and a daily dump works
fine. There are 50,000+ users and 20,000+ devices: printers/computers/servers ... I dump the group memberships also: my users/devices are moved all over.