cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pema123
Frequent Visitor

Power Automate MS Graph and distribution lists

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 AutomatePower 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?

Graph.PNG

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 

1 ACCEPTED SOLUTION

Accepted Solutions

The solution will be to create an Azure Automation job in powershell to add user to distribution group.

View solution in original post

2 REPLIES 2
pema123
Frequent Visitor

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.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,604)