0
votes

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

1

1 Answers

0
votes

Well, I finally found that a lot of things related to AD should NOT be done directory through Azure AD, but directly on your on-premise Active Directory.

These modifications can then be synchronized thanks to Microsoft tools (ex: Azure AD Connect).

Doing so is so much easier than using Microsoft Graph which is not really ready for prime time for several things.