无法通过Microsoft Graph API更新到已启用邮件的安全组

时间:2018-04-09 13:18:54

标签: microsoft-graph

通过Microsoft Graph API将安全组(通过API创建)更新为已启用邮件的安全组时,我遇到了以下错误。

{
  "error": {
    "code": "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.",
    "innerError": {
      "request-id": "34bc9a4d-9e52-4c2e-b847-99f8dbf43518",
      "date": "2018-04-09T13:05:10"
    },
    "details": [
      {
        "target": "mailEnabled",
        "code": "InvalidValue"
      }
    ]
  }
}

根据https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/group_update#request-body文档,我相信可以建立一个启用了邮件功能的安全组。

这是原始请求(通过Fiddler捕获)。

PATCH https://graph.microsoft.com/v1.0/groups<<groupId>> HTTP/1.1
Accept: application/json
Authorization: Bearer <<Authorization Token>>
Content-Type: application/json; charset=utf-8
Host: graph.microsoft.com
Content-Length: 96
Expect: 100-continue
Connection: Keep-Alive

{"mailEnabled":true,"mailNickname":"<<mailNickName>>"}

请建议是否需要以不同的格式形成请求?

1 个答案:

答案 0 :(得分:1)

我担心Microsoft Graph不完全支持已启用邮件的安全组。来自documentation

  

无法通过API创建已启用邮件的安全组,但其他组操作可以正常运行。已启用邮件的安全组是只读的。

可以通过Exchange管理已启用邮件的安全组。您可以在Manage mail-enabled security groups in Exchange 2016中找到有关详细信息。