Monkey in Pajamas
Monkey in Pajamas

Reputation: 35

C# ASP.NET Retrieving thousands of Active Directory records

I need to display in a Report a list of users along with their full names and email addresses that match certain criteria for an application that is running in our domain. The current application that I will be reporting of already knows all of the Active Directory "Usernames", but "Display Name" and "Email address" for each one of the users are not present in the application database.

These reports could potentially contain up to 25k records, and I am not sure how efficient will it be to query Active Directory for 25k records (only displayname and email will be queried), or instead query the local database for those fields. These reports may be ran daily (up to 10x in one day).

Here is the question, should I add a table to the application's database and run an overnight script to populate a table with each username, display name and email address for each of the application users? (approximately 25,000 users), or should I query Active Directory for those fields every time a report is requested, which ultimately pull up to 250,000 the usernames and email addresses of the users in these reports?

Thanks

Upvotes: 0

Views: 236

Answers (1)

markp3rry
markp3rry

Reputation: 734

AD is usually of vital importance to an organisation and I would think twice about introducing a process that's going to pull 250,000 records from it every time someone runs a report. At best you're going to upset the network administrators and at worst you're going to stop users logging in, downloading patches etc.

Overnight job would be preferable (IMHO) and then you have a little bit more work to get the data into the report but it will be worth it in the long run.

Upvotes: 2

Related Questions