Getting to Global Address List Using VB6 and Outlook Object Model

Using some advice from last year I attempted to get to the Global Address List that Outlook 2003 users could see using VB.  For WHATEVER reason, going at it directly using LDAP:// I can't see all the entries even though I can when in Outlook.  So, I thought I'd go a completely different tact and go after it by using the Outlook Object model instead... Set adl = olNs.AddressLists("Global Address List").  But when I do that I can't get to any of the contact details that you can see when in Outlook.  Is there another way to get to the Global Address List using the Outlook Object Model so that one can see the details?
srbentleyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David LeeCommented:
Hi, srbentley.

"going at it directly using LDAP:// I can't see all the entries even though I can when in Outlook"
What can't you see?
0
srbentleyAuthor Commented:
I can only see entries in my state.  SELECT sn, mail, st FROM LDAP://blahblah WHERE st = 'GA' works great.  But if I fill in other states, even though I can see them while in Outlook, I can find none.  I can see entries for Tampa, FL in Outlook, but in my VB program if I say WHERE l (lower case 'L' which is city) = 'Tampa', none are returned.
0
David LeeCommented:
Have you tried using GC instead of LDAP?
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

srbentleyAuthor Commented:
Please elaborate.  What is GC?
0
srbentleyAuthor Commented:
Ok, found some other articles regarding GC.   I'll try that.
0
David LeeCommented:
Sorry, I wasn't available earlier when you asked what GC is.  GC stands for Global Catalog.  In Active Directory an LDAP query only goes against the local domain.  If you're in a forest with multiple domains, then your query won't see the other domains.  The Global Catalog is just what it sounds like, a catalog of all records in the forest.   A query against it will return all records regardless of where they are.  

You said that your LDAP query gets Georgia but misses records from other states, and that sounds like multiple domains might be the problem.  If a GC query doesn't do any better, then that's not the problem.  GC queries are almost identical to an LDAP query, with one exception.  An LDAP query can be targeted at the domain, allowing AD to find the nearest DC rather than you having to specify one.  GC queries need to be target at a specific DC that you know holds the GC role.

One other difference between the two is what's available from each.  The Global Catalog does not have a copy of all the properties that make up an item.  It has a subset.  If you find that you need a property that's not available from the GC, then get the items ADSPATH and followup with an LDAP query to get the missing details.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
srbentleyAuthor Commented:
I've been trying to get someone to answer this for months, but we finally got on the right track... the cursed forest.  Simply chaning LDAP to GC did the trick.  Unbelieveable. Thanks!!!
0
David LeeCommented:
No problem.  Glad I could help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.