I have the following PowerShell script:
$creategroupbody = @{
displayName = "ABC"
mailEnabled = $false
securityEnabled = $false
mailNickname = "ABC"
groupTypes = @("Unified")
resourceBehaviorOptions = @("WelcomeEmailDisabled", "HideGroupInOutlook")
}
$createGroupUrl = 'https://graph.microsoft.com/v1.0/groups'
$createGroupResponse = Invoke-RestMethod -Uri $createGroupUrl -Method POST -Headers $header -Body ($creategroupbody | ConvertTo-Json)
$groupid = $createGroupResponse.id
My goal is to create a group where the added members do not receive a welcome email, I've leveraged the options here, namely "WelcomeEmailDisabled" set to false.
However users still receive welcome emails when I added users to my group. Further more in the "Azure - Audit logs" section I see that the properties in the group creating don't correspond to the group that I created, namely:
And I don't see the "resourceBehaviorOptions" defined in the "Modified Properties" tab:
Why is that, it's like it's not reading in the passed in parameters, and the behavior is not consistent with the options.
I read this post which is trying to do something similar and is facing a issue when users are added immediately, I've yet to test adding a user after 15 minutes(I add them right away too) so maybe that's what I'm facing though the options I'm using are a bit different than that post.
I wish this post had a good answer, I basically need to do the opposite...