# Generate a report of user groups and permissions

**URL:** <https://community.dynatrace.com/t/generate-a-report-of-user-groups-and-permissions/40447>\
**Category:** Open Q&A\
**Tags:** user-management, account-management, dynatrace-saas\
**Created:** [June 29, 2023, 9:27am UTC](https://community.dynatrace.com/t/generate-a-report-of-user-groups-and-permissions/40447 "2023-06-29T09:27:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ypareek007](https://avatars.discourse-cdn.com/v4/letter/y/5fc32e/32.png) [@ypareek007](https://community.dynatrace.com/u/ypareek007)\
**Post date:** [June 29, 2023, 9:27am UTC](https://community.dynatrace.com/t/generate-a-report-of-user-groups-and-permissions/40447/1 "2023-06-29T09:27:16Z")

</div>

Hi, How can I generate a report from Dynatrace SaaS account that should have all the user groups and the permissions assigned to those user groups along with the users added to each group? I tried looking at account management APIs but I could find API just to get groups for a single user and the response doesn’t show the permissions assigned to the group. Couldn’t find a way to generate from the UI as well. Please can someone help me with this. TIA

---

<div class="post-metadata">

**Author:** ![vasile\_gafton](https://avatars.discourse-cdn.com/v4/letter/v/51bf81/32.png) [@vasile\_gafton](https://community.dynatrace.com/u/vasile_gafton)\
**Post date:** [June 29, 2023, 10:05am UTC](https://community.dynatrace.com/t/generate-a-report-of-user-groups-and-permissions/40447/2 "2023-06-29T10:05:47Z")

</div>

Hi,

you can use the following 2 API to get:

1. The users assigned to a group:&nbsp;  
[Group management API - GET group members — Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/account-api-groups-get-members)
2. The permissions assigned to a group  
[Permission management API - GET permissions — Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/account-api-permissions-get)

---

<div class="post-metadata">

**Author:** ![ypareek007](https://avatars.discourse-cdn.com/v4/letter/y/5fc32e/32.png) [@ypareek007](https://community.dynatrace.com/u/ypareek007)\
**Post date:** [June 29, 2023, 5:28pm UTC](https://community.dynatrace.com/t/generate-a-report-of-user-groups-and-permissions/40447/3 "2023-06-29T17:28:38Z")

</div>

Thank you. Is there a way I can use these APIs to get details of all the groups and permissions at once?

---

<div class="post-metadata">

**Author:** ![vasile\_gafton](https://avatars.discourse-cdn.com/v4/letter/v/51bf81/32.png) [@vasile\_gafton](https://community.dynatrace.com/u/vasile_gafton)\
**Post date:** [June 29, 2023, 11:04pm UTC](https://community.dynatrace.com/t/generate-a-report-of-user-groups-and-permissions/40447/4 "2023-06-29T23:04:53Z")

</div>

Hey,

yes thats possible.  
Here are the steps in the right order

1. Create an OAuth2 client with the following permissions:&nbsp;account-idm-read  
[Authenticate to Account Management with OAuth clients — Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/account-api-authentication#create-an-oauth2-client)

2. Use the ID and the secret of your OAuth2 client to receive a bearer token from the Dynatrace SSO system via an API call.  
Provide the exact same permissions as your client (account-idm-read)  
[Authenticate to Account Management with OAuth clients — Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/account-api-authentication#request-a-token)

3. Use the retrieved bearer token as an authorization header for your Account management API requests

4. Get the list of all groups  
[Group management API - GET all groups — Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/account-api-groups-get-all)  
For each group you will get also the UUID.&nbsp;  
Example:

5. For each group in the list get the list of users and the list of permissions  
[Group management API - GET group members — Dynatrace Docs](https://www.dynatrace.com/support/help/shortlink/account-api-groups-get-members)  
[https://www.dynatrace.com/support/help/shortlink/account-api-permissions-get](https://www.dynatrace.com/support/help/shortlink/account-api-permissions-get)

You can either write a script for this or use the Account Management API explorer:  
[Dynatrace Account Management API](https://api.dynatrace.com/spec/)

---

<div class="post-metadata">

**Author:** ![ct\_27](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ct_27/32/10499_2.png) [@ct\_27](https://community.dynatrace.com/u/ct_27)\
**Post date:** [June 30, 2023, 4:20am UTC](https://community.dynatrace.com/t/generate-a-report-of-user-groups-and-permissions/40447/5 "2023-06-30T04:20:07Z")

</div>

This would be a great RFE for Dynatrace to build such an out-of-the-box report like this. It could be part of the new myaccount/Account Management interface.

---

<div class="post-metadata">

**Author:** ![ypareek007](https://avatars.discourse-cdn.com/v4/letter/y/5fc32e/32.png) [@ypareek007](https://community.dynatrace.com/u/ypareek007)\
**Post date:** [June 30, 2023, 8:40am UTC](https://community.dynatrace.com/t/generate-a-report-of-user-groups-and-permissions/40447/6 "2023-06-30T08:40:17Z")

</div>

Thank you for the detailed steps. This helps but my only concern is I have 63 user groups and as you mentioned in step 5, I can use APIs to get details about each group, so looks like I will have to run those APIs 63 times to get info about all groups. I will try to write an automated script to do that but if you are aware of a better way, please do let me know. Thanks again for all your support 🙂

---

<div class="post-metadata">

**Author:** ![vasile\_gafton](https://avatars.discourse-cdn.com/v4/letter/v/51bf81/32.png) [@vasile\_gafton](https://community.dynatrace.com/u/vasile_gafton)\
**Post date:** [June 30, 2023, 9:34am UTC](https://community.dynatrace.com/t/generate-a-report-of-user-groups-and-permissions/40447/7 "2023-06-30T09:34:53Z")

</div>

I m afraid there is no better solution at the moment 🙂

---

<div class="post-metadata">

**Author:** ![ct\_27](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/ct_27/32/10499_2.png) [@ct\_27](https://community.dynatrace.com/u/ct_27)\
**Post date:** [June 30, 2023, 1:26pm UTC](https://community.dynatrace.com/t/generate-a-report-of-user-groups-and-permissions/40447/8 "2023-06-30T13:26:58Z")

</div>

[@ypareek007](https://community.dynatrace.com/user/48843)&nbsp;I get your frustration. I have similar posts 3 years back when I joined Dynatrace.&nbsp; I have to say the DynaMight people (before they were DynaMights) helped me out through this forum with ProTips and just helping build stuff for me. It’s no guarantee things will be solved for you, but this community is very supportive.

What I eventually did was stood up a small VM with Node.js (v14 or greater) and installed Node-Red.&nbsp; I work for a not-for-profit so I’m good, but read over the open source community license to be sure you’re in compliance.&nbsp; I used Node-Red to do all my complicated Dynatrace API efforts. I have over 15 automated scripts that help handle daily administrative tasks, it generated Daily problem email reports, it captures metrics, it does a lot.&nbsp; Node-Red can be a no-code solution but with Dynatrace I’d say it’s more like a Low-Code solution with Javascript.

I’ll help you out and writeup a Node-Red flow that does what Vasile documented above. I could actually use it as well. Then post the Node-Red flow, which is just a JSON, here for you download.

What I begrudgingly learned in my first year with Dynatrace is to survive you have to be able to heavily interact with the APIs.&nbsp; You have to be able to iterative through the ‘NextPage’ process to get all your data. So you really have to code the API or have something like Node-Red.

Dynatrace will suggest two things to you. Monaco, which is awesome (v2 all the way) but solves a slightly different need. And the new Automated Workflows which beyond the 3 free ones have a cost.

---

<div class="post-metadata">

**Author:** ![ypareek007](https://avatars.discourse-cdn.com/v4/letter/y/5fc32e/32.png) [@ypareek007](https://community.dynatrace.com/u/ypareek007)\
**Post date:** [July 3, 2023, 11:41am UTC](https://community.dynatrace.com/t/generate-a-report-of-user-groups-and-permissions/40447/9 "2023-07-03T11:41:39Z")

</div>

That’s great and sounds useful. I do have experience in using Dynatrace APIs using coded programs. I had built some programs last year using VBScript which calls Dynatrace APIs, get JSON results and convert them to MS Excel and finally share as an email with all the stakeholders. I suppose I will try to modify it to generate report as per my current need. I do appreciate your offer to help though. Even though I might not need but if you still write Node-Red flow, please share with me to learn about that more.
