在 Python 中获取 Exchange 分发列表的成员
Get members of Exchange Distribution List in Python
使用 exchangelib,您如何获得全局分发列表的成员列表?在包含的测试用例中,我看到了如何在联系人的文件夹中创建和删除 DL,但不引用全局 DL。如有必要,我愿意使用不同的 Python 库。
更新:这是我到目前为止所尝试过的。使用此代码,我可以转储我的个人通讯组列表(和其他联系人)的列表,包括成员。我想我需要在某种全球范围内 "point" my_folder
来查看全球分发列表,而不是我个人联系人中的分发列表。
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)
exchangelib 作者在此:全局地址簿尚未在 exchangelib 中实现,不幸的是:https://github.com/ecederstrand/exchangelib/issues/93
编辑:GAL 文件夹和 FindPeople / GetPersona 服务现已实现,因此现在应该可以使用了。
使用 exchangelib,您如何获得全局分发列表的成员列表?在包含的测试用例中,我看到了如何在联系人的文件夹中创建和删除 DL,但不引用全局 DL。如有必要,我愿意使用不同的 Python 库。
更新:这是我到目前为止所尝试过的。使用此代码,我可以转储我的个人通讯组列表(和其他联系人)的列表,包括成员。我想我需要在某种全球范围内 "point" my_folder
来查看全球分发列表,而不是我个人联系人中的分发列表。
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)
exchangelib 作者在此:全局地址簿尚未在 exchangelib 中实现,不幸的是:https://github.com/ecederstrand/exchangelib/issues/93
编辑:GAL 文件夹和 FindPeople / GetPersona 服务现已实现,因此现在应该可以使用了。