Scripts Thread, Best way to deal with Active Directory in Coding and Web Development; Ok i just wondered if anyone knows the best way to deal with pulling data out of AD. What i ...
21st April 2009, 02:51 PM #1
Best way to deal with Active Directory
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?
21st April 2009, 04:49 PM #2
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 :-)
22nd April 2009, 09:36 AM #3
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.
By ICTNUT in forum How do you do....it?
Last Post: 28th November 2012, 03:21 AM
By steveo2000 in forum Mac
Last Post: 6th April 2009, 11:26 PM
By MrPstv in forum Windows Server 2000/2003
Last Post: 26th March 2009, 08:26 PM
By Neville in forum Windows
Last Post: 25th June 2008, 04:24 PM
Last Post: 31st January 2008, 01:17 PM
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)