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 / Adding Users to a Shar...
Power Automate
Answered

Adding Users to a SharePoint Security Group

(0) ShareShare
ReportReport
Posted on by 1,362

Hello, 
I am attempting to add a user to a security group but I am receiving an error that states:

golfnutt82_0-1633983828840.png

golfnutt82_1-1633983862738.png

 

Any help would be appreciated

 

Categories:
I have the same question (0)
  • golfnutt82 Profile Picture
    1,362 on at

    I saw that I was missing the single quotes around the folder name just before /Users but now getting this error.

    golfnutt82_0-1633984360204.png

     

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @golfnutt82 

     

    Just written an article on this https://www.damobird365.com/add-members-to-a-distribution-list/, it's a lot easier to use the add members to group action.  All you need is the security group GUID, the same process applies for Distribution lists too.

     

    Please consider accepting my answer as a solution if it helps to solve your problem.

    Cheers
    Damien

    Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts, or take a look at my website. Thanks

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @golfnutt82 

     

    Forgive me - you are referring to SharePoint Security groups... 😂  I need to hit the sack

     

    Give me a moment to look into it for you.

     

    Damien

  • DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @golfnutt82 

     

    I think you are missing single quotes around the security group name.

     

    https://contoso.sharepoint.com/sites/DamoBird365/_api/web/siteGroups/getByName('DamoBird365%20Owners')/users

     

    Damien

  • golfnutt82 Profile Picture
    1,362 on at

    Hi and thanks for your reply.
    Everything that I am doing is automated.
    I am creating the security permission groups based on input from the user.
    If the user inputs from a drop down "Secure Folder" then new library is created, site permissions are broken or disenherited and a new security group is created that is based on a the user role; in this case a contibute group is created for the library. After the role creation approval happens people can then request access to the role/security group and if approved they are added to that security group and this is where I am finding difficulty.
    I feel I am close.
    Everything is automated and being driven by HTTP requests and api REST 

  • golfnutt82 Profile Picture
    1,362 on at

    Hi, 
    Yes, I found those to but it didnt help.
    Still digging.

  • golfnutt82 Profile Picture
    1,362 on at

    I changed the URI syntax to look as follows:

    golfnutt82_1-1634040092012.png

    Getting this error now

    golfnutt82_0-1634040030918.png

     

  • Verified answer
    DamoBird365 Profile Picture
    8,942 Microsoft Employee on at

    Hi @golfnutt82 

     

    This worked for me

    DamoBird365_0-1634066497100.png

    Header:

    {
    "accept": "application/json;odata.metadata=none",
    "content-type": "application/json"
    }

     

    Body:

    {'LoginName':'i:0#.f|membership|damien@abdndamodev.onmicrosoft.com'}

    note the single quotes on the body - don't ask!?

     

    Here is the success...

    DamoBird365_1-1634066606740.png

     

     

    Please consider accepting my answer as a solution if it helps to solve your problem.

    Cheers
    Damien

    Please take a look and subscribe to my YouTube Channel for more Power Platform ideas and concepts, or take a look at my website. Thanks

  • golfnutt82 Profile Picture
    1,362 on at

    I had a typo I believe, uhg.

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 707

#2
Haque Profile Picture

Haque 475

#3
Valantis Profile Picture

Valantis 456

Last 30 days Overall leaderboard