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='[email protected]', 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)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With