Alok Agarwal
Alok Agarwal

Reputation: 3099

Exchange Server: How to expand distributed list to get all the members

We are building client for exchange server using python3.X as a language.

We found an existing library exchangelib, to perform all the basics operations including move, copy, delete etc email.

However we have an additional requirement to expand distributed list to get all the members of same. Unfortunately this feature is not available in library.

Open Issue: https://github.com/ecederstrand/exchangelib/issues/93

Is there an alternate way to achieve same using web services provided by exchange. If so any help on any relevant link will be of great help.

Thanks in advance.

Upvotes: 1

Views: 1201

Answers (1)

BastianW
BastianW

Reputation: 2658

As requested:

How to expand a distribution group by using the EWS Managed API or EWS in Exchange example:

private static void ExpandDistributionLists(ExchangeService service)
{
     // Return the expanded group.
     ExpandGroupResults myGroupMembers = service.ExpandGroup("[email protected]");

     // Display the group members.
     foreach (EmailAddress address in myGroupMembers.Members)
     {
         Console.WriteLine("Email Address: {0}", address);
     }
}

source here or here

Upvotes: 2

Related Questions