How can I add/remove contacts to/from O365 distribution lists using C#?
In PowerShell this can be done using the commands Add-DistributionGroupMember, Remove-DistributionGroupMember from the module ExchangePowershell.
How can I add/remove contacts to/from O365 distribution lists using C#?
In PowerShell this can be done using the commands Add-DistributionGroupMember, Remove-DistributionGroupMember from the module ExchangePowershell.
It is not clear what technology you would like to use. There are several ways to get the job done in C#:
Automate Outlook from your C# application. See How To: Create a new distribution list item in Outlook for more information. Note, Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment. Read more about that in the Considerations for server-side Automation of Office article.
Use EWS, see Explore the EWS Managed API, EWS, and web services in Exchange for more information.
Use Graph API, see Working with groups in Microsoft Graph.