• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 318
  • Last Modified:

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?
0
srbentley
Asked:
srbentley
  • 4
  • 4
1 Solution
 
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
Free tool for managing users' photos in Office 365

Easily upload multiple users’ photos to Office 365. Manage them with an intuitive GUI and use handy built-in cropping and resizing options. Link photos with users based on Azure AD attributes. Free tool!

 
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
 
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

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now