web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Cannot Update a mail-e...
Power Automate
Suggested Answer

Cannot Update a mail-enabled security groups and or distribution list.

(1) ShareShare
ReportReport
Posted on by 1,946 Season of Giving Solutions 2025
I have a list of Groups IDs, which include; Security Groups, Mail-Enabled Security group, Distribution lists, Office 365 groups.
 
now i have a user email and the user ID. and i want to remove the user from all the groups:-
 
I tried using Graph API:-
 
 
and using the built-in Remove Member from group:-
 
 
 
but both raised the same error, on distribution lists and mail-enabled groups:-
 
Cannot Update a mail-enabled security groups and or distribution list.
 "error": {
    "code": "Request_BadRequest",
    "message": "Cannot Update a mail-enabled security groups and or distribution list.",
}
 
any advice how to remove those members?
Categories:
I have the same question (0)
  • Suggested answer
    Pstork1 Profile Picture
    69,452 Most Valuable Professional on at
    Check the note in this documentation. Learn about groups, group membership, and access - Microsoft Entra | Microsoft Learn. Distribution Lists and mail enabled security groups can only be managed in Exchange. Currently there is no way to do it from Power Automate or MS Graph.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • johnjohnPter Profile Picture
    1,946 Season of Giving Solutions 2025 on at
    @Pstork1 ok thanks for the info. so let say i created an Http azure function, which can be called from power automate, will i be able to do this inside my azure function?
  • Pstork1 Profile Picture
    69,452 Most Valuable Professional on at
    The Azure function would be using the same API so I would assume the limitation would still apply.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • w.p Profile Picture
    8,345 Super User 2026 Season 1 on at
    Just putting the option out here—have you considered using PowerShell or Power Automate Flow through PowerShell?
  • johnjohnPter Profile Picture
    1,946 Season of Giving Solutions 2025 on at
     
    I need the service to be called using URL, as inside our service desk we need to call this end-point,, so not sure how i can call power shell script from power automate? is this is possible, then yes i am open to this option,, thanks
     
    Is it possible to remove a member from a security group using power shell? also i am open to use azure function..
  • w.p Profile Picture
    8,345 Super User 2026 Season 1 on at
    @johnjohnPter
    I don't have the access, but I came across this topic before.
    You may need to do some research or create another post specifically about it—someone might be able to assist.
     
    Ben Stegink: Getting started with Azure Automation and Power Automate
     
     
    DamoBird365:
    How to Restore a Deleted Power Automate Flow via PowerShell, Power Automate and Power Apps
    Trigger Flow when you log on, run from Windows Batch or PowerShell Script Power Automate
    https://youtu.be/kPbn4WMCXUU
     
    Salaudeen Rajack: Connect to Microsoft Graph with Connect-MgGraph in PowerShell
     
  • Suggested answer
    w.p Profile Picture
    8,345 Super User 2026 Season 1 on at
    Maybe you don't need PowerShell; I just tested it with a security group.
    Method: DELETE
    https://graph.microsoft.com/v1.0/groups/{group-id}/members/{user-id}/$ref
     
     
      
  • w.p Profile Picture
    8,345 Super User 2026 Season 1 on at
     
    Sorry, I take it back. After a quick look, it seems PowerShell is your only option, since mail-enabled security groups are managed by Exchange and aren’t exposed in Power Automate.
     
    SharePoint Diary - Salaudeen Rajack
    Office 365: Remove a user from All Security groups using PowerShell

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 840

#2
Valantis Profile Picture

Valantis 661

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard