Solved

Active Directory Queries: Compare and Contrast ADODB and GetObject methods

Posted on 2008-10-30
6
322 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 200 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 300 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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.
Let's recap what we learned from yesterday's Skyport Systems webinar.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

623 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