我正在尝试使用 .NET Microsoft.Graph SDK 创建两个组并将一个添加到另一个组。组创建很好,它们显示在 Microsoft Graph Explorer 中。但是,当我尝试将该组添加到另一个组时,出现错误:
Microsoft.Graph.ServiceException
HResult=0x80131500
Message=Code: Request_BadRequest
Message: An invalid operation was included in the following modified references: 'members'.
Inner error
Source=Microsoft.Graph.Core
StackTrace:
at Microsoft.Graph.HttpProvider.<SendAsync>d__19.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.BaseRequest.<SendRequestAsync>d__36.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.BaseRequest.<SendAsync>d__31.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at [mycode].cs:line 170
我正在添加具有以下内容的组:
await _serviceClient.Groups[memberGroup.Id]
.Members
.References
.Request()
.AddAsync(new Group { Id = adminGroup.Id });
编辑这些是安全组