I want to use the MS Graph API to set the auto reply configuration for an Office 365 group (groupType=’Unified’).
I am able to do this for users, but I have not been able to do it for groups.
Here is the method I have tried:
$payload = "
{
'@odata.context': https://graph.microsoft.com/v1.0/`$metadata#Me/mailboxSettings',
'automaticRepliesSetting': {
'status': 'scheduled',
'externalAudience': 'all',
'scheduledStartDateTime': {
'dateTime': '2024-09-12 09:00:00',
'timeZone': 'UTC'
},
'scheduledEndDateTime': {
'dateTime': '2024-09-12 22:00:00',
'timeZone': 'UTC'
},
'internalReplyMessage': 'message goes here',
'externalReplyMessage': 'message goes here'
}
}"
Invoke-MGGraphRequest `
-uri "/groups/<GROUP_ID>/mailboxSettings" `
-method 'PATCH' `
-body $payload
This is the response I receive:
Invoke-MgGraphRequest: PATCH https://graph.microsoft.com/groups/<GROUP_ID>/mailboxSettings
HTTP/2.0 404 Not Found
Vary: Accept-Encoding
Strict-Transport-Security: max-age=31536000
request-id: <REQUEST_ID>
client-request-id: <CLIENT_REQUEST_ID>
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"Australia Southeast","Slice":"E","Ring":"3","ScaleUnit":"001","RoleInstance":"ML1PEPF0000E51D"}}
Date: Thu, 12 Sep 2024 03:09:24 GMT
Content-Type: application/json
Content-Encoding: gzip
{"error":{"code":"ResourceNotFound","message":"Invalid version: groups","innerError":{"date":"2024-09-12T03:09:24","request-id":<REQUEST_ID>,"client-request-id":<CLIENT_REQUEST_ID>}}}
Is it possible to do this?
2
There doesn’t seem to be a Graph endpoint for updating an O365 Shared Mailbox automatic replies settings thus far.
The existing Create settings
and Update groupSetting
endpoints have no indication that automatic replies is supported based on the existing groupSettingTemplates
.
The alternative can be to use Set-MailboxAutoReplyConfiguration
or the API used behind the scenes.
$setMailboxAutoReplyConfigurationSplat = @{
Identity = '[email protected]'
AutoReplyState = 'Scheduled'
ExternalAudience = 'All'
StartTime = '2024-09-12 09:00:00'
EndTime = '2024-09-12 22:00:00'
InternalMessage = 'message goes here'
ExternalMessage = 'message goes here'
}
Set-MailboxAutoReplyConfiguration @setMailboxAutoReplyConfigurationSplat
2