MSI
MSI

Reputation: 1134

Read / Process large number of data using DirectorySearcher API

Context

Not an expert in this ground. I am trying to come up with a solution design for a scenario where I need to poll AD and

Ideally, if it was database, I would have the option to

(and thus leave it to the connection pool to juggle stuff and allow others to do their stuff).

I am really interested in knowing the best practice / approach in this case which is scaleable. I only need to fetch those 2 properties for all users (of course we have filters - e.g. remove inactive)

Personally, I was wondering if I should

and so on.

Suggestions?

Upvotes: 2

Views: 229

Answers (1)

Chris Dent
Chris Dent

Reputation: 4260

Filter at source wherever possible. Return minimal property sets wherever possible.

You could leverage DirectorySynchronization, but I would say there is only value in doing so where you have a significant amount of client-side calculation to do. I use this to technique to manage photos in AD. I have a offline synchronized set which has the photo as a hash that can be used to ensure I only update where required, and when I update I only pull down changes from the directory since last execution.

For actions based on pwdLastSet or lastLogonTimeStamp I will always generate (LDAP) filters that allow me to ask AD for the smallest result set. I will always request the smallest number of attributes I actually need to work with.

Upvotes: 0

Related Questions