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 / Get users and security...
Power Automate
Suggested Answer

Get users and security roles for all environment

(2) ShareShare
ReportReport
Posted on by 617

Hi,

as part of our monitoring of the Power Platform and users permissions I'm trying to get a list of users with their associated security roles for all environments that have a Dataverse database.

 

According to this post, this is not possible, but the post is already quite old, so things might have changed.

 

In this post they explain that you need to add a "set" suffix to the table relationship name, but for me this does not work (see screenshot). I get an error "table not found".

 

leo85_0-1651756386726.png

 

Using the expand query with the "Users" table also does not work (there is no error, but no data is retrieved about the user roles).

leo85_1-1651757598446.png

 

Edit: When I use the current Dataverse connector (instead of the legacy one), it does work, but only for the current environment. This is unfortunately not sufficient, because we have 200+ environments and I can't replicate the flow this many times.

leo85_1-1651762606882.png

 

 

Does anybody know how to get the information without doing it by hand?

 

Regards

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @leo85 ,

     

    Please try:

    items('Apply_to_each')?['properties/linkedEnvironmentMetadata/instanceUrl']

    vbofengmsft_0-1652065750682.png

     

    Best Regards,

    Bof

  • leo85 Profile Picture
    617 on at

    Hi @v-bofeng-msft ,

    thank you for the reply. Unfortunately, accessing the environment itself is not the problem, but getting the right data from the table. My flow is using the code you supplied.

     

    leo85_0-1652076624521.png

     

    Regards

    Leo

     

  • Rómulo Profile Picture
    14 on at

    @leo85Hi, did you find the workaround?

    Thanks,

    RR

  • Suggested answer
    LR-12081549-0 Profile Picture
    2 on at

    Here's what worked for me:

    I first followed the guide in this post: Retrieve List of Users and Roles in Environment, and then I applied the solution provided by v-bofeng-msft.

     

    List rows from selected environment: 

    items('Apply_to_each_-_environment')?['properties/linkedEnvironmentMetadata/instanceUrl']

    Apply to each: outputs('List_rows_from_selected_environment')?['body/value']

    Apply to each 2: items('Apply_to_each')?['systemuserroles_association']
     

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 957

#2
Valantis Profile Picture

Valantis 847

#3
Haque Profile Picture

Haque 609

Last 30 days Overall leaderboard