public static void Run() { // ExStart:DeletePrivateDistributionList IEWSClient client = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain"); ExchangeDistributionList[] distributionLists = client.ListDistributionLists(); client.DeleteDistributionList(distributionLists[0], true); // ExEnd:DeletePrivateDistributionList }
public static void Run() { // ExStart:DeleteWithoutListing IEWSClient client = EWSClient.GetEWSClient("https://outlook.office365.com/ews/exchange.asmx", "testUser", "pwd", "domain"); ExchangeDistributionList distributionList = new ExchangeDistributionList(); distributionList.Id = "list's id"; client.DeleteDistributionList(distributionList, true); // ExEnd:DeleteWithoutListing }