如何使用python exchangelib将成员添加到exchange2010中的通讯组列表中?还有其他可用的库来执行这些任务吗?
答案 0 :(得分:0)
“还请帮我获取 Exchange Server 2010 中的 DL 列表”=> 见下文,获取分发列表成员的代码。
def get_distro_emails(dist_list):
credentials = Credentials('username', os.environ.get('password'))
account = Account('someone@company.com', credentials=credentials, autodiscover=True)
emails = []
try:
for mailbox in account.protocol.expand_dl(dist_list):
emails.append(mailbox.email_address)
except Exception as e:
print(str(e))
return emails