public static void Run()
{
// ExStart:AddMembersWithoutListing
IEWSClient client = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain");
ExchangeDistributionList distributionList = new ExchangeDistributionList();
distributionList.Id = "list's id";
distributionList.ChangeKey = "list's change key";
MailAddressCollection newMembers = new MailAddressCollection();
newMembers.Add("[email protected]");
client.AddToDistributionList(distributionList, newMembers);
// ExEnd:AddMembersWithoutListing
}
}