You cannot use the Graph API for that. Mail-enabled security groups are authored in Exchange Online, and Graph currently has no support for Exchange admin operations. Use PowerShell instead.
Unable to create/modify Mail-enabled security groups via Microsoft Graph API.
I'm unable to create/modify/add-remove users to Mail-enabled security groups. I was able to create/modify using powershell but i want to achieve this via API. How do i achieve this via API. Suggest me to resolve this issue. 2 problems using powershell in my case, 1. It is not returning Object Id when group created via powershell. 2. It doesn't reflect in system immediately.
Error while creating Group via 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': {
'date': '2021-04-22T05:09:50',
'request-id': '1a2f4780-a404-4cab-a482-e8603de244f3',
'client-request-id': '1a2f4780-a404-4cab-a482-e8603de244f3'
},
'details': [
{
'target': 'mailEnabled',
'code': 'InvalidValue'
}
]
}
}
While updating groups
{
'error': {
'code': 'Request_BadRequest',
'message': 'Unable to update the specified properties for objects that have originated within an external service.',
'innerError': {
'date': '2021-04-22T05:03:30',
'request-id': '341693ab-7cb6-47d8-8f1c-998e36b082d1',
'client-request-id': '341693ab-7cb6-47d8-8f1c-998e36b082d1'
}
}
}