How to Create a custom Report to List Users within a Specific Role

How to Create a custom Report to List Users within a Specific Role

81
Created On 11/10/26 10:54 AM - Last Modified 11/10/26 15:54 PM


Objective


This article guides you through creating a custom SQL-based report in the Identity Administration portal. This report queries the database directly to list all users belonging to a specific role (e.g., "Privilege Cloud Users") and shows their username, email address, and last login time. This is an alternative to using a JavaScript-based report for user and role auditing



Environment


Identity Reports

Procedure


1. Open the Admin Portal and navigate to Reports > New Report.
2. Name your report (e.g., 'Role Members Login Report') and click Save.
3. Click on Edit Script and paste the following script:

--

SELECT 
    u.username,
    u.email,
    u.lastlogin
FROM 
    User u
INNER JOIN 
    RoleMember rm ON rm.ID = u.ID || '_' || (
        SELECT r.ID 
        FROM Role r 
        WHERE r.Name = 'Privilege Cloud Users'
    )

--

4. Save and run the report.

You can customize the role name or add additional fields as needed.



Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000000thFCAQ&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail