Jump to content

Recommended Posts

Posted
Ok i just wondered if anyone knows the best way to deal with pulling data out of AD. What i mean is that i have a database of users which i need to update info from active directory. Now is it better to load both arrays into memory and do the searches there, or to do the searches on the fly?
Posted

Not quite sure what you mean!

 

What I have done in the past when I've got a lot of updates to do is create an LDAP query to find the users I'm going to update (could be all of them!). You then get that in a recordset and step through it one at a time. For each user, you then call out to (say) your SQL database, get the new info, update the AD record and move on.

 

You can link SQL server to AD so that you can do links between the 2 dbs and then do big update statements but that's always seemed a bit scary to me :-)

Posted

Ok if forgot to say that I'm VB scripting, and I'll try to explain..

 

Assume i have an SQL database that holds user information, now if i were to update either AD using this database (or even the other way round) I would need to go through each user and match it with the users in AD. Now the update bit isnt the problem (not that my question is a problem really) but this search can be done in a number of ways. For example you can open a record set of one database and loop through all its records. For each record you can open a record set to the other database and loop through each of its records till you find a match. Another way of doing it is to dump both databases into an Array variable then much like the above method you would loop through both arrays to find a match. Now both ways will work but the question is, which is the better way weighing up factors like efficiency, server load(s), impact on both databases and speed.

 

At the moment im leaning towards dumping the databases into memory as it means that the impact on both databases will only be the initial dump where it gets all the user details.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...