1
votes

I'm getting below error while updating a security group (created through API) to mail enabled security group via Microsoft Graph 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"
      }
    ]
  }
}

As per https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/group_update#request-body documentation, I believe it is possible to have a security group with mail enabled feature.

This is raw request(Captured through 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>>"}

Please suggest if the request need to formed in a different format?

1

1 Answers

1
votes

I'm afraid Mail-enabled Security Groups are not fully supported by Microsoft Graph. From the documentation:

Mail-enabled security groups can't be created through the API, but other group operations work. Mail-enabled security groups are read only.

Mail-enabled security groups can be managed via Exchange. You can find more details on this in Manage mail-enabled security groups in Exchange 2016.