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
pema123
Frequent Visitor

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"
    }
pema123
Frequent Visitor

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

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,768)