public static void Run()
{
// ExStart:CreatePrivateDistributionList
IEWSClient client = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain");
ExchangeDistributionList distributionList = new ExchangeDistributionList();
distributionList.DisplayName = "test private list";
MailAddressCollection members = new MailAddressCollection();
members.Add("[email protected]");
members.Add("[email protected]");
members.Add("[email protected]");
client.CreateDistributionList(distributionList, members);
// ExEnd:CreatePrivateDistributionList
}
}