Hi,
I really hope someone can explain this to me. I've created a flow in Power Automate for sending an HTTP request to MSGraph for adding a user to a distribution list (oh yes it finally works). But in my flow I get an error saying you can't add user to mail enabled groups or distribution lists.
Power Automate
If I copy the URI and body from my Power Automate flow to Microsoft graph explorer (https://aka.ms/ge) it works like a charm.
Why do I get this behavior from Power Automate even when I choose to run an HTTP request?
Ok, the uri and body does not show in my Power Automate image but i made a copy/paste so it is the same data.
Thanks,
Peter
Solved! Go to Solution.
The solution will be to create an Azure Automation job in powershell to add user to distribution group.
Just to be clear the below json is what i send to MS Graph.
{
"uri": "https://graph.microsoft.com/v1.0/groups/[GroupID]/members/$ref",
"method": "POST",
"authentication": {
"authority": "https://login.microsoft.com",
"tenant": "[TenantID]",
"audience": "https://graph.microsoft.com",
"clientId": "[ClientID]",
"secret": "[ClientSecret]",
"type": "ActiveDirectoryOAuth"
},
"body": {
"@odata.id": "https://graph.microsoft.com/v2/[TenantID]/directoryObjects/[UserID]/Microsoft.DirectoryServices.User"
}
The solution will be to create an Azure Automation job in powershell to add user to distribution group.
User | Count |
---|---|
102 | |
38 | |
31 | |
24 | |
16 |
User | Count |
---|---|
132 | |
53 | |
52 | |
37 | |
26 |