10

Using exchangelib, how do you get a list of the members of a Global Distribution List? In the included test case I see how to create and delete a DL within a folder in your Contacts, but not referencing a global DL. I'm open to using a different Python library if necessary.

Update: Here's what I have tried so far. Using this code I'm able to dump a list of my personal Distribution Lists (and other contacts) including the members. I'm thinking I need to "point" my_folder at some sort of global scope to see global Distribution Lists as opposed to those in my personal Contacts.

from exchangelib import DELEGATE, Account, Credentials, Configuration

credentials = Credentials(username='domain\\account', password='passw0rd')
config = Configuration(server='mail.example.com', credentials=credentials)
account = Account(primary_smtp_address='foo@example.com', config=config,
              autodiscover=False, access_type=DELEGATE)
my_folder = account.contacts
all_items_without_caching = my_folder.all().iterator()
for item in all_items_without_caching:
    print(item)
stdout
  • 1,761
  • 1
  • 18
  • 33

1 Answers1

2

exchangelib author here: the global address book is not implemented in exchangelib yet, unfortunately: https://github.com/ecederstrand/exchangelib/issues/93

EDIT: The GAL folder and FindPeople / GetPersona services are now implemented, so this should work now.

Erik Cederstrand
  • 9,643
  • 8
  • 39
  • 63