I'm trying to create a distribution group (not an Office 365 group (so not a unified group), and not a security group) thanks to Microsoft Graph Api without any success. I'm always getting an error.
var client = new GraphServiceClient(new AzureAuthenticationProvider());
Group group = new Group();
group.DisplayName = "Test Liste";
group.MailEnabled = true;
group.SecurityEnabled = false;
group.GroupTypes = new string[] {"DynamicMembership"};
group.MailNickname = "testliste";
var newG = client.Groups.Request().AddAsync(group).Result;
Console.WriteLine(newG.Id);
An exception is raised telling me that it is not supported : Request_BadRequest Message: The service does not currently support writes of mail-enabled groups. Please ensure that the mail-enablement property is unset and the security-enablement property is set.
If it is not possible how to do this in C# without powershell, which API should be used to do that ?
Regards