Search code examples
perlapplescriptexchange-serverexchangewebservices

How can I query the Exchange Global Addresslist with Applescript or Perl?


I want to extract some addresses from Exchange's Global Address list but have absolutely no clue where to start.

I'm using a Mac and so the idea was to use applescript, but I do not understand how to even connect to the GAL.

I also could not find any examples yet. Does someone here know of some examples how to work with Exchange's global address list using Applescript? Or maybe in Bash or Perl?


Solution

  • The main issue I had was finding the LDAP servers for my case.

    Finally I found information how to do this, and it's quite simple:

    dig -t SRV +short _ldap._tcp.my.do.main
    

    When I have the server name (or names) it's simply a matter of authenticating and browsing around to find the infos required.

        ldapsearch -h "$LDAP_SERVER" -p "$LDAP_PORT" -b "$USER_BASEDN" -D "$LDAP_USER" -w "$PASSWD" "(&(QUERY))"