In diesem Fall erstellt wurde, können Sie das Microsoft Graph prüfen, mit - Create Group
Stellen Sie zunächst sicher, dass Sie der App in Azure AD die Berechtigung "Microsoft Graph"> "Lesen und Schreiben aller Gruppen" zugewiesen haben.
-Code für Ihre Referenz:
string authority = "https://login.windows.net/yourdomain.onmicrosoft.com";
string clientId = "{client_id}";
Uri redirectUri = new Uri("http://localhost");
string resourceUrl = "https://graph.microsoft.com";
HttpClient client = new HttpClient();
AuthenticationContext authenticationContext = new AuthenticationContext(authority, false);
AuthenticationResult authenticationResult = authenticationContext.AcquireToken(resourceUrl,
clientId, redirectUri, PromptBehavior.Always);
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + authenticationResult.AccessToken);
string content = @"{
'displayName': 'mailgrouptest',
'groupTypes': ['Unified'],
'mailEnabled': true,
'mailNickname': 'mailalias1',
'securityEnabled': false
}";
var httpContent = new StringContent(content, Encoding.GetEncoding("utf-8"), "application/json");
var response = client.PostAsync("https://graph.microsoft.com/v1.0/groups", httpContent).Result;
Console.WriteLine(response.Content.ReadAsStringAsync().Result);
Alle Codes, die Sie versucht? – Raptor
Nein. Neu in diesem Bereich ... – bijupranavam
Beginnen Sie mit dem Lernen von C# und schreiben Sie Codes, bevor Sie danach fragen. – Raptor