19

Has anyone ever succeeded in searching for names in an Exchange GAL linked to an iOS device, using ABAddressBook framework, or otherwise?

I've managed to get all the names from the contacts stored on the device - that bit's easy - but it doesn't include names from the Exchange GAL.

I've also managed to get the ABSource for the GAL. It's type is: kABSourceTypeExchangeGAL = kABSourceTypeExchange | kABSourceTypeSearchableMask

This suggests the source is searchable, given that the kABSourceTypeSearchableMask bit is set (kABSourceTypeSearchableMask = 0x01000000), but how to search it is anyone's guess? The documentation is almost non-existent.

There are similar stackoverflow questions listed below, but none of them provides a solution for this.

ABAddressBookCopyArrayOfAllPeopleInSource(addressBook, sourceToSearch) always returns an empty array for sources that include the type bit kABSourceTypeSearchableMask, which suggests that you have to search by name, rather than return "all people" because the Global Address List could have thousands and thousands of people in it, so I wouldn't expect it to return them all.

Contacts app allows you to search by name and shows only those that match. As does Mail app when entering text in the "To:" text field.

Community
  • 1
  • 1
Sam
  • 5,822
  • 1
  • 22
  • 27
  • I tried, and when you search the GAL, it behaves as if it's searching the non-GAL exchange contacts address book. I doubt that functionality is built in as it would allow apps with permissions to contacts to grab an entire organization's list of members. – ecsos Apr 14 '14 at 19:48

1 Answers1

1

I am fairly sure this is not allowed -- by Microsoft.. Based on this http://social.msdn.microsoft.com/Forums/en-US/85713cae-c969-4abd-836f-394c2ed815d9/finding-contacts-in-exchange-global-address-list-using-ews-managed-api?forum=exchangesvrdevelopment and a quick wireshark trace, it looks like GAL queries are really LDAP queries being run directly against the DC...

XeroxDucati
  • 4,880
  • 1
  • 28
  • 63