简体   繁体   English

C#ASP.NET检索数千个Active Directory记录

[英]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. 我将报告的当前应用程序已经知道所有Active Directory“用户名”,但每个用户的“显示名称”和“电子邮件地址”不在应用程序数据库中。

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. 这些报告可能包含多达25k条记录,我不确定查询Active Directory 25k记录的效率(仅查询显示名称和电子邮件),或者在本地数据库中查询这些字段。 These reports may be ran daily (up to 10x in one day). 这些报告可以每天运行(一天内最多10次)。

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? (大约25,000个用户),或者我应该在每次请求报告时查询Active Directory以获取这些字段,这最终会在这些报告中最多提取250,000个用户的用户名和电子邮件地址?

Thanks 谢谢

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. AD通常对组织至关重要,我会考虑引入一个流程,每当有人运行报告时,该流程将从中提取250,000条记录。 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. 一夜之间的工作会更好(恕我直言)然后你需要更多的工作来将数据输入报告,但从长远来看它将是值得的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM