Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Active Directory Queries: Compare and Contrast ADODB and GetObject methods

Posted on 2008-10-30
6
Medium Priority
?
326 Views
Last Modified: 2013-12-24
In my last question is was suggested that for large Active Directory databases that the ADODB method should be used over the GetObject method. I'm not sure I fully understand the difference between these methods.

Could someone please show some samples of these methods, comment on the code involved, and  elaboate as much as possible on when each is to be used?

Thanks,

JB
0
Comment
Question by:JB4375
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 17

Assisted Solution

by:Jared Luker
Jared Luker earned 800 total points
ID: 22847328
When I'm trying to work with user objects, I use the ADODB method to get the users Distinguished Name.  Once I have the DN stored in a variable, I can use the GetObject method to get all of the properties of that particular object.

If there are 200 objects in an OU I'm trying to work with, it seems best to use the ADODB method inside a loop.  It allows me to cycle through the objects and then use GetObject to work with each object as it comes through the loop.

Does that help?
0
 
LVL 1

Author Comment

by:JB4375
ID: 22847447
Ok... so I guess I got the complete wrong impression that the ADODB and the Get Object methods were mutually exclusive?
0
 
LVL 65

Accepted Solution

by:
RobSampson earned 1200 total points
ID: 22847605
They kind of work hand in hand.  You can get by with running ADODB queries to retrieve information, and it *does* enumerate a lot faster than many GetObject calls, but, if you want to change properties of object, you must "bind" to the object using GetObject, then modify the properties.

An article such as this show you both of these methods at work:

How Can I Standardize the Logon Name for All My Users?
http://www.microsoft.com/technet/scriptcenter/resources/qanda/mar08/hey0325.mspx

Regards,

Rob.
0
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 1

Author Comment

by:JB4375
ID: 22849390
Thanks for all the info guys. That really helped.
0
 
LVL 1

Author Closing Comment

by:JB4375
ID: 31511924
Jared - Provided a clear and concise answer.

Rob- Provided a clear and concise answer as well, but with additional recommended article to illustrate further.
0
 
LVL 65

Expert Comment

by:RobSampson
ID: 22854472
No problem. Thanks for the grade.

Regards,

Rob.
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After seeing many questions for JRNL_WRAP_ERROR for replication failure, I thought it would be useful to write this article.
In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question