+ Post New Thread
Results 1 to 3 of 3
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 ...
  1. #1
    apeo's Avatar
    Join Date
    Sep 2005
    Location
    Lost
    Posts
    1,612
    Thank Post
    95
    Thanked 115 Times in 111 Posts
    Rep Power
    42

    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?

  2. #2

    Join Date
    Aug 2005
    Location
    London
    Posts
    3,154
    Thank Post
    114
    Thanked 527 Times in 450 Posts
    Blog Entries
    2
    Rep Power
    123
    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 :-)

  3. #3
    apeo's Avatar
    Join Date
    Sep 2005
    Location
    Lost
    Posts
    1,612
    Thank Post
    95
    Thanked 115 Times in 111 Posts
    Rep Power
    42
    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.

SHARE:
+ Post New Thread

Similar Threads

  1. Active Directory Auditing??
    By ICTNUT in forum How do you do....it?
    Replies: 8
    Last Post: 28th November 2012, 02:21 AM
  2. Replies: 0
    Last Post: 6th April 2009, 10:26 PM
  3. active directory
    By MrPstv in forum Windows Server 2000/2003
    Replies: 5
    Last Post: 26th March 2009, 07:26 PM
  4. Active Directory
    By Neville in forum Windows
    Replies: 6
    Last Post: 25th June 2008, 03:24 PM
  5. Replies: 7
    Last Post: 31st January 2008, 12:17 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •