It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to obtain list of active users in Confluence

Frank McPherson Mar 01, 2013

I am unable to determine how to obtain a list of all users with Global Permissions. I need to do this because Confluence reports, after I upgraded to 5.0.1, that I'm exceeding my license count with 103 active users. My JIRA installation reports 100 users. Confluence is using JIRA's user directory read-only.

I am also unable to figure out how to list users by directory in Confluence - it may be that I have a couple of users in the internal directory and don't know it.

The Atlassian Answers document at https://confluence.atlassian.com/display/CONFKB/How+to+Get+a+List+of+Active+Users+Counting+Towards+the+Confluence+License claims that the UI will provide a list of all users with Global permissions, via the Administration->Global Permissions screen. This is unfortunately not the case in either Confluence 4.3.5 or 5.0.1.

4 answers

1 accepted

0 votes
Answer accepted
Daniel Borcherding Mar 03, 2013

Another important thing to remember that if you have deactivated users in your instnace they will need to be removed from all groups that have the "CAN USE" permission.

As you rightly state you may have some users kicking around in the confluence internal directory. This will at minimum contain the user that you used to set up Confluence. It is not the best idea in the world, as it robs you of a back door into your instnace, but you can remove the Confluence internal directory from the list of user directories. I would not recommend this, but if you are at your license cap, it is a temporary mitigation.

I would consider if every user in JIRA really needs to access Confluence.

We have the following document on removing or deactivating users

https://confluence.atlassian.com/display/DOC/Removing+or+Deactivating+Users

You may just wish to remov those users that do not need access to your instance.

0 votes
Eddie Webb Mar 01, 2013

The document states: "You can click on each group individually to reveal their members."

Which does not seem to be true from the "global permissions" page, but if you browse to the "groups" browser, there is a listing of the count for each group. Clicking that count will reveal the list of users.


0 votes
Frank McPherson Mar 10, 2013

Both answers, from Eddie Web and Daniel Borcherding, were helpful. I also ended up generating a list directly from the SQL. This query lists each Jira user and their last login time:

SELECT DISTINCT u.user_name, to_timestamp(CAST(cua.attribute_value AS double precision)/1000) AS last_login 
FROM cwd_user_attributes cua
JOIN cwd_user u ON u.id = cua.user_id
JOIN cwd_membership m
ON u.id = m.child_id
AND u.directory_id = m.directory_id
JOIN schemepermissions sp
ON LOWER(m.parent_name) = LOWER(sp.perm_parameter)
JOIN cwd_directory d
ON m.directory_id = d.id
WHERE cua.user_id = u.id AND cua.attribute_name = 'lastAuthenticated' AND sp.permission IN ('0','1','44') AND d.active = '1' and u.active = '1'
ORDER BY last_login;

Joseph P Jun 13, 2019

This is an updated and simplified version of it:

SELECT DISTINCT u.user_name, to_timestamp(CAST(cua.attribute_value AS double precision)/1000) AS last_login 
FROM cwd_user_attribute cua
JOIN cwd_user u ON u.id = cua.user_id
WHERE u.active = 'T' AND cua.attribute_name = 'lastAuthenticated'
ORDER BY last_login;
0 votes
viranga Jayalath Oct 17, 2018

Commands
---------------------
https://confluence.atlassian.com/jirakb/how-to-get-a-list-of-active-users-counting-towards-the-jira-application-license-278695452.html

login to jira server (if RDS) or jira DB


SELECT DISTINCT u.lower_user_name
FROM   cwd_user u
       JOIN cwd_membership m
         ON u.id = m.child_id
            AND u.directory_id = m.directory_id
       JOIN licenserolesgroup lrg
         ON Lower(m.parent_name) = Lower(lrg.group_id)
       JOIN cwd_directory d
         ON m.directory_id = d.id
WHERE  d.active = '1'
       AND u.active = '1'
    AND license_role_name = 'jira-software';


copy the output to a file in local pc

cat /tmp/xxx | sed 's/^[ \t]*//;s/[ \t]*$//' > /tmp/output.file
sed 's/$/,/' output.file > output2.file
cat output2.file | tr -d '\n' > output3.file

 

go to confluence , find your group and past the comma separated user list to group 

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Confluence

6 Awesome Ways to Apply Trello, JIRA and Confluence to your Project

I attended  Atlassian Summit 2019  and learned a lot from the presenters, attendees and knowledgeable Atlassian product managers. The presentations I attended focused on applying Agile, pla...

2,179 views 11 27
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you