How to add members to a distribution list in exchange2010 using python exchangelib? Any other library available to perform these tasks?
Asked
Active
Viewed 361 times
1
-
Also please help me to get list of DL's in exchange server 2010 – Sheik Kalidh May 09 '19 at 16:06
-
Please help me to get it done. – Sheik Kalidh May 10 '19 at 04:55
-
Appreciate help on this. – Sheik Kalidh May 11 '19 at 04:58
-
You can only hope to do that with exchangelib if EWS supports it. Have you seen documentation that it's possible with EWS? – Erik Cederstrand May 13 '19 at 15:22
-
https://social.technet.microsoft.com/Forums/exchange/en-US/cf855703-341d-4421-8afc-68c4975bd955/add-and-remove-users-from-exchange-distribution-groups-programmatically-c?forum=exchangesvrdevelopment I dont think so, EWS has such options. Any alternate way to achieve this. – Sheik Kalidh May 14 '19 at 04:23
-
Then you should look into PowerShell commands that you can run directly on the Exchange server. – Erik Cederstrand May 14 '19 at 07:07
1 Answers
1
"Also please help me to get list of DL's in exchange server 2010" => see below, code to get members of distribution list.
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

Adam Jarzebak
- 11
- 1