cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
T4S-Rick
Level: Power Up

"Add user to group" (Azure AD) does not accept user ID retrieve with "Get User"

I created a flow that gets an email address (for a person already in Azure AD) and should add them to several AD groups.

 

The sequence is:

AzureAD: Get User - passing in email address (triggered by SharePoint list add)

AzureAD: Add User to Group - Passing in:

  - The ObjectID of the AD mail-enabled security group (retrieved using PowerShell Get-AzureADGroup command)

  - The id value returned by the "Get User" (where id is described as "a unique identifier for the user")

 

This results in an 400 Bad Request error with the message: Unable to update the specified properties for objects that have originated within an external service

 

The only doc I can find does not specify if this connector is limited to specific types of AD groups: https://docs.microsoft.com/en-us/connectors/azuread/

 

So, the most likely problem is that I'm not passing in the correct values. Is that it? Or is it that I can't add users to mail-enabled security groups? Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: "Add user to group" (Azure AD) does not accept user ID retrieve with "Get User&qu

HI @T4S-Rick,

 

I tried the same where inside my flow I first run a create group. This givces me the ID of the group created and then I add my users to that group.

 

This all works.

 

The Get group neeed to have the id to get the rest of the group details. You could check if this id matches the one you generated with PowerShell.

 

 

You should probably try with a flow that looks a bit like this:

 

UserGroupFlow.PNG

View solution in original post

2 REPLIES 2
Super User
Super User

Re: "Add user to group" (Azure AD) does not accept user ID retrieve with "Get User&qu

HI @T4S-Rick,

 

I tried the same where inside my flow I first run a create group. This givces me the ID of the group created and then I add my users to that group.

 

This all works.

 

The Get group neeed to have the id to get the rest of the group details. You could check if this id matches the one you generated with PowerShell.

 

 

You should probably try with a flow that looks a bit like this:

 

UserGroupFlow.PNG

View solution in original post

Highlighted
rmcsmile
Level: Powered On

Re: "Add user to group" (Azure AD) does not accept user ID retrieve with "Get User&qu

Just a heads up on this issue.  I confirmed with the Flow team that adding users to mail enabled security groups is not supported at this time.  There's another post on Flow Ideas to get this fixed:  https://powerusers.microsoft.com/t5/Flow-Ideas/Azure-AD-Add-user-to-mail-enabled-security-group/idi-...

 

Please vote!

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Speakers, submit your sessions now! Call for speakers ends Feb. 10!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,592)