Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-54271

Have a screen that shows a list of users counting towards Confluence license

    • 567
    • 83
    • We collect Confluence feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Problem Definition

      We currently have a count of the licenses currently in use in Confluence, but we don't have a list of which users are consuming these licenses.

      Suggested Solution

      • Have a screen that will list out the users that are consuming towards the license, complete with the details on which group/user directory they belong to
        • Somewhat like what JIRA have in their Application Access page. See screenshot for details

      Why this is important

      When users have a Confluence instance with a large set of users and nested groups, sometimes the count is different than the actual number of users. It is important to know exactly which users are consuming these licenses.

      Workaround

      If using Confluence 7.0.2, or enterprise releases 6.6.17+ or 6.13.9+:
      1. Go to the "Logging and profiling" administration screen
      2. Add an entry for "com.atlassian.confluence.user.DefaultUserAccessor" with level "DEBUG"
      3. Go to the "License Details" administration screen
      4. Tail your Confluence log file
      5. Hit the "Refresh" button under the "Licensed users" section
      6. Look for a line like this in your log file
      2019-09-17 10:36:34,271 DEBUG [read-only-transaction:thread-1] [atlassian.confluence.user.DefaultUserAccessor] getUserNamesWithConfluenceAccess Found n licensed users: [user1, user2, ...] 
      Ensure that only selected groups are counted towards the license:
      1. Create a group with all users that should be counting towards the license;
      2. Create a new filter using the group created's DN;
      3. In Confluence, go to the cog icon >> User Management;
      4. On the left sidebar, select User Directories;
      5. Click to Edit your current directory;
      6. Under User Schema >> User Object Filter, paste the filter created;
      7. Save the changes and synchronize.
      Use SQL query to list out users that are counted towards the license:

      How to get a list of active users counting towards the Confluence license.

      However, the above SQL query will not list users that are counted towards the license as a result of nested groups.

      Create a user macro:

      Create a User Macro
      Use the following code into the macro:

      ## Macro title: Last Login
      ## Macro has a body: N
      ## Body processing: Selected body processing option
      ## Output: Selected output option
      ##
      ## Developed by: Andrew Frayling
      ## Modified by: Michael Seager [Atlassian Support]
      ## Date created: 11/02/2012
      ## Installed by: <your name>
      ## Macro to display the last login date of users who have access to the current space
      ## @noparams
       
      #set($containerManagerClass = $content.class.forName('com.atlassian.spring.container.ContainerManager'))
      #set($getInstanceMethod = $containerManagerClass.getDeclaredMethod('getInstance',null))
      #set($containerManager = $getInstanceMethod.invoke(null,null))
      #set($containerContext = $containerManager.containerContext)
      #set($loginManager = $containerContext.getComponent('loginManager'))
      #set($users = $userAccessor.getUsers())
      
      <table class="confluenceTable">
        <tr>
          <th class="confluenceTh">Count</th>
          <th class="confluenceTh">User</th>
          <th class="confluenceTh">Last Successful Login</th>
        </tr>
       
      #set($count = 0)
       
      #foreach($user in $users)
        ## list the last login date of users who can view the current space
        #if ($permissionHelper.canView($user, $space))
          #set($count = $count + 1)
          <tr>
            <td class="confluenceTd">$count</td>
            <td class="confluenceTd">#usernameLink($user.name)</td>
          
            <td class="confluenceTd">$action.dateFormatter.formatDateTime($loginManager.getLoginInfo($user.name).lastSuccessfulLoginDate)</td>
           
          </tr>
        #end
      #end
      </table>
      

      Add the macro into a page
      Do note that this is a macro created by third party. There is no guarantee that this user macro will be working in your version and in the future version.
      Also note that this user macro will not count if the user(s) has no view permission to the space this macro is placed in. It is recommended to place this in a space that everyone has view permission. (Page Restriction however, is not affected)

      Script based on the REST API

      If you use a specific group to manage access to Confluence, then the following shell script will give you the list of all users that are assigned to that group.
      jq CLI is needed to format the API method output.

      USRNAME=admin
      USRPWD=admin
      CONFBASEURL=http://localhost:6682/confluence
      GROUP_NAME=confluence-users
      echo "Username;Fullname" > /tmp/confluence_users.list
      
      REST_NEXT_LINK=/rest/experimental/group/$GROUP_NAME/member
      while [ "$REST_NEXT_LINK" != "null" ]; do
       REST_FULL_RESULT=$(curl --user $USRNAME:$USRPWD -H "Content-Type: application/json" -H "Accept: application/json" $CONFBASEURL$REST_NEXT_LINK 2>/dev/null)
       echo $REST_FULL_RESULT | jq -r '.results[] | "\(.username);\(.displayName)"' >> /tmp/confluence_users.list
       REST_NEXT_LINK=$(echo $REST_FULL_RESULT | jq -r '._links.next' 2>/dev/null)
      done
      
      Atlassian status as of November 10, 2022

      Dear Customers,

      Thank you for your patience in waiting for us to look into this issue. We understand the level of frustration that would be caused by the lack of this feature. When the number of licence seats becomes exhausted and Confluence goes into read-only mode it can pause vital business activity across an organisation and needs to be remedied quickly. This is why we are taking a multi-step approach towards resolving this issue.

      In Confluence 8.0 we will be shipping the capability for the UI to filter in only licensed users along with the capability to view last logged-in dates within the user browser (CONFSERVER-1556). This is to help admins quickly discover users that could be disabled and free up license seats on the spot.

      We do realise that this solution may have some shortcomings for our larger customers, so soon in Confluence 8.x we wish to also ship an API that will output an instance’s user list with their last logged-in date which is filterable by either; all, licenced, or unlicensed statuses.

      We hope that these two increments will help solve for the problem of licensing visibility across our application. In the meantime other solutions around this include:

      Kind regards,

      Michael Andreacchio | Product Manager - Confluence DC

            [CONFSERVER-54271] Have a screen that shows a list of users counting towards Confluence license

            Dear Customers, 

            Thank you all so much for your patience.  Just coming back with an update re. this feature request. As part of our last release Confluence 8.0, we have released improvements to the License details page, where now as a Confluence admin, you can get a clearer picture of unused or idle accounts consuming your license to manage your license usage more effectively.

            On that basis, I'll be closing this ticket.

            Please reach out to our team if you have any questions or concerns.

            Kind regards, 

            Mauricio Franzoni

            Confluence DC Product Manager

            Mauricio Franzoni (Inactive) added a comment - Dear Customers,  Thank you all so much for your patience.  Just coming back with an update re. this feature request. As part of our last release  Confluence 8.0 , we have released improvements to the  License details page , where now a s a Confluence admin, you can get a clearer picture of unused or idle accounts consuming your license to manage your license usage more effectively. On that basis, I'll be closing this ticket. Please reach out to our team if you have any questions or concerns. Kind regards,  Mauricio Franzoni Confluence DC Product Manager

            Dear Customers, 

             

            Thank you all so much for your patience. This feature is currently being looked into by our team, we have a working demo of what this may look like and are excited to get this feature out to you shortly. We hope to bring you more information about this shortly and look forward to being able to ship it within a coming release.

            Kind regards,

             

            Michael Andreacchio

            Confluence DC Product Manager

            Michael Andreacchio added a comment - Dear Customers,    Thank you all so much for your patience. This feature is currently being looked into by our team, we have a working demo of what this may look like and are excited to get this feature out to you shortly. We hope to bring you more information about this shortly and look forward to being able to ship it within a coming release. Kind regards,   Michael Andreacchio Confluence DC Product Manager

            Jeanne Howe added a comment - - edited

            This is one of the most BASIC of administration needs that EVERY application MUST have.

            This BUG, not a suggestion, is now over 5 years old.

            Once again, Atlassian shafting their Data Center customers.

            You remember us Atlassian, the ones who helped you build to the company you are today?

            Jeanne Howe added a comment - - edited This is one of the most BASIC of administration needs that EVERY application MUST have. This BUG, not a suggestion, is now over 5 years old. Once again, Atlassian shafting their Data Center customers. You remember us Atlassian, the ones who helped you build to the company you are today?

            +1 

            Andrei Trif added a comment - +1 

            +1

            What is the update on this? It seems to have been created years ago. 
            As Sharon said, this should be essential and should be default as it is in Jira. 

            Chris Wood added a comment - What is the update on this? It seems to have been created years ago.  As Sharon said, this should be essential and should be default as it is in Jira. 

            Essential! Can't understand why it's not available by default, as it is in Jira. the only way I know we have exceeded out active user licenses is when we are told of problems creating any new content by a user!

            Sharon Meyler added a comment - Essential! Can't understand why it's not available by default, as it is in Jira. the only way I know we have exceeded out active user licenses is when we are told of problems creating any new content by a user!

            +1

            Sunil Kuuram added a comment - +1

            Would be very useful to have such a function similar to the user management in Jira (server).

            Robert Schneider added a comment - Would be very useful to have such a function similar to the user management in Jira (server).

            +1 for this feature as an API call.

            Venkat Patchigolla added a comment - +1 for this feature as an API call.

            This needs to be implemented soon .

            Vickey Palzor Lepcha added a comment - This needs to be implemented soon .

            Santosh SG added a comment -

            Please implement this feature as it will be very helpful in our enterprise confluence instance also

            Santosh SG added a comment - Please implement this feature as it will be very helpful in our enterprise confluence instance also

            Need this feature as an API call too, "list all licensed users".

            Jamie Simon added a comment - Need this feature as an API call too, "list all licensed users".

            Fabian Hußl added a comment - - edited

            Hi, the user macro is a nice workaround, but it's not working anymore in Atlassian Confluence 7.0.2. In this Knowledge Base Article it's still also the way to do.

            The column Last Successful Login is empty. Can someone help? 

            I think the problem is, that 'loginManager' is deprecated. See Deprecated code paths removed in 7.0

            Fabian Hußl added a comment - - edited Hi, the user macro is a nice workaround, but it's not working anymore in Atlassian Confluence 7.0.2. In this  Knowledge Base Article  it's still also the way to do. The column  Last Successful Login  is empty. Can someone help?  I think the problem is, that 'loginManager' is deprecated. See  Deprecated code paths removed in 7.0

            Caution - Running the user macro above against an instance with a lot of users may cause the instance to stop responding.

            Lance Parkes added a comment - Caution - Running the user macro above against an instance with a lot of users may cause the instance to stop responding.

            SimonH added a comment -

            And the Jira search feature is pretty poor too, so that's a low bar to reach!

            SimonH added a comment - And the Jira search feature is pretty poor too, so that's a low bar to reach!

            I find it rather sad that Confluence has such a poor user search feature as compared to Jira.

            Deleted Account (Inactive) added a comment - I find it rather sad that Confluence has such a poor user search feature as compared to Jira.

            Hi everyone,

            Thanks for your patience with this issue. As an interim solution, we have built into Confluence some new logging that does provide the list of usernames that count towards the license. This logging will be available in the upcoming Confluence 7.0.2 and above. It will also be available in enterprise releases 6.6.17+ and 6.13.9+. I have updated the workarounds in this ticket to include those instructions. Hopefully this workaround is sufficient for most admins. This ticket will now track the development of a user interface for listing the licensed users, similar to what we have in Jira.

            Regards,
            Niraj Bhawnani.
            Engineering Manager, Confluence Server
            Atlassian

            Niraj Bhawnani added a comment - Hi everyone, Thanks for your patience with this issue. As an interim solution, we have built into Confluence some new logging that does provide the list of usernames that count towards the license. This logging will be available in the upcoming Confluence 7.0.2 and above. It will also be available in enterprise releases 6.6.17+ and 6.13.9+. I have updated the workarounds in this ticket to include those instructions. Hopefully this workaround is sufficient for most admins. This ticket will now track the development of a user interface for listing the licensed users, similar to what we have in Jira. Regards, Niraj Bhawnani. Engineering Manager, Confluence Server Atlassian

            jannachang added a comment -

            Without this feature, it does not enforce Atlassian's customers upgrading to the next level of license count.  Instead, it is highly likely to drive the existing customers seeking alternative solutions or even moving away from Confluence.

            I would urge Atlassian to move up the priority of enabling this feature.

            The majority SW licenses are by counting number of current active users, not by counting the number of login users.

             

            jannachang added a comment - Without this feature, it does not enforce Atlassian's customers upgrading to the next level of license count.  Instead, it is highly likely to drive the existing customers seeking alternative solutions or even moving away from Confluence. I would urge Atlassian to move up the priority of enabling this feature. The majority SW licenses are by counting number of current active users, not by counting the number of login users.  

            Does not make since why this is not already available 

            Shamrock IT Business added a comment - Does not make since why this is not already available 

            For those looking for a workaround, there is a database query you can run to get this information out of the database directly.  This requires admin rights to the server so I realize it's not an option for some users who only have access to the web UI.

            https://community.atlassian.com/t5/Confluence-questions/How-to-find-last-login-date-of-users-in-Confluence/qaq-p/328807#M55405

            Here is the SQL script that works for me (my database is postgres10.x).

            We also use this to identify licensed users who haven't logged into Confluence for a long time, so we can reclaim their licenses if they don't need access anymore.

            -- CTE (Common Table Expression)
            WITH RECURSIVE recursive_groups ( group_id, name, directory_id)
            AS
            (
            	-- Anchor, i.e. the login groups
            	SELECT
            		g.id, group_name, directory_id
            	FROM
            		cwd_group g
            		JOIN cwd_directory d ON (g.directory_id = d.id)
            	WHERE
            		d.active = 'T' -- only enabled directories
            		AND g.group_name in ('confluence-users','confluence-administrators','LDAP-Group-for-Confluence-Users') -- put your login groups here
            	UNION ALL
            	-- Recursive sub groups
            	SELECT
            		g.id, g.group_name, g.directory_id
            	FROM
            		cwd_membership m
            		JOIN recursive_groups to_the_root ON (to_the_root.group_id = m.parent_id)
            		JOIN cwd_group g ON (m.child_group_id = g.id)
            		JOIN cwd_directory d ON (g.directory_id = d.id)
            	WHERE
            		d.active = 'T' -- only enabled directories
            )
            SELECT
            	distinct u.id AS UserId, u.lower_user_name AS User, u.display_name AS FullName, l.SUCCESSDATE AS LastLogin, du.directory_name AS DirectoryName
            FROM
            	recursive_groups g
            	JOIN cwd_membership m ON (m.parent_id = g.group_id)
            	JOIN cwd_user u ON (u.id = m.child_user_id)
            	JOIN cwd_directory du ON (u.directory_id = du.id)
            	LEFT JOIN user_mapping map ON (map.username = u.user_name)
            	LEFT JOIN logininfo l ON (l.USERNAME = map.user_key)
            WHERE
            	u.active = 'T' -- only enabled users
            ORDER BY
            	u.lower_user_name
            

             

             

            Jeffrey Thornsen added a comment - For those looking for a workaround, there is a database query you can run to get this information out of the database directly.  This requires admin rights to the server so I realize it's not an option for some users who only have access to the web UI. https://community.atlassian.com/t5/Confluence-questions/How-to-find-last-login-date-of-users-in-Confluence/qaq-p/328807#M55405 Here is the SQL script that works for me (my database is postgres10.x). We also use this to identify licensed users who haven't logged into Confluence for a long time, so we can reclaim their licenses if they don't need access anymore. -- CTE (Common Table Expression) WITH RECURSIVE recursive_groups ( group_id, name, directory_id) AS ( -- Anchor, i.e. the login groups SELECT g.id, group_name, directory_id FROM cwd_group g JOIN cwd_directory d ON (g.directory_id = d.id) WHERE d.active = 'T' -- only enabled directories AND g.group_name in ( 'confluence-users' , 'confluence-administrators' , 'LDAP-Group- for -Confluence-Users' ) -- put your login groups here UNION ALL -- Recursive sub groups SELECT g.id, g.group_name, g.directory_id FROM cwd_membership m JOIN recursive_groups to_the_root ON (to_the_root.group_id = m.parent_id) JOIN cwd_group g ON (m.child_group_id = g.id) JOIN cwd_directory d ON (g.directory_id = d.id) WHERE d.active = 'T' -- only enabled directories ) SELECT distinct u.id AS UserId, u.lower_user_name AS User, u.display_name AS FullName, l.SUCCESSDATE AS LastLogin, du.directory_name AS DirectoryName FROM recursive_groups g JOIN cwd_membership m ON (m.parent_id = g.group_id) JOIN cwd_user u ON (u.id = m.child_user_id) JOIN cwd_directory du ON (u.directory_id = du.id) LEFT JOIN user_mapping map ON (map.username = u.user_name) LEFT JOIN logininfo l ON (l.USERNAME = map.user_key) WHERE u.active = 'T' -- only enabled users ORDER BY u.lower_user_name    

            SimonH added a comment -

            If that CSV file is downloaded to my PC, then that's great.  If it is initiated via the UI, but gets saved onto a server with no way of accessing it as a non-techie, then that's not a lot of help to me.

            SimonH added a comment - If that CSV file is downloaded to my PC, then that's great.  If it is initiated via the UI, but gets saved onto a server with no way of accessing it as a non-techie, then that's not a lot of help to me.

            There should be two solutions to this issue:

            1. The ability to export a .csv file via the UI (solves for the common non-technical use case)
            2. A specific API call that returns a list of all users that are consuming a license with the option of returning their last login date/time 

            Michael Dennis added a comment - There should be two solutions to this issue: The ability to export a .csv file via the UI (solves for the common non-technical use case) A specific API call that returns a list of all users that are consuming a license with the option of returning their last login date/time 

            Same here: +1

            Sven Wagner added a comment - Same here: +1

            Trying to track licenses manually has been a big waste of my time.  Please add this feature!

            Diana Carter added a comment - Trying to track licenses manually has been a big waste of my time.  Please add this feature!

            Mira Kim added a comment -

            Hi there, my team currently manages multiple sites with up to 5000+ users per site. Having a feature like this would be great as we link to our own directory with many nested groups. Not knowing which users take up a license makes managing vendor access difficult and potentially a security issue. It would be great to control user access from this portal too (ie. immediately remove a user from the license count). Thank you!

             

            Mira Kim added a comment - Hi there, my team currently manages multiple sites with up to 5000+ users per site. Having a feature like this would be great as we link to our own directory with many nested groups. Not knowing which users take up a license makes managing vendor access difficult and potentially a security issue. It would be great to control user access from this portal too (ie. immediately remove a user from the license count). Thank you!  

            Lara added a comment -

            Hi @Simon, hi suggest using the macro and checking the groups. Remember that you might have people in confluence-administrators that are not in confluence-user counting on your licence....

            Lara added a comment - Hi @Simon, hi suggest using the macro and checking the groups. Remember that you might have people in confluence-administrators that are not in confluence-user counting on your licence....

            I currently have 47 users on my 50 user licence, and Confluence thinks I have 53, but won't tell me who they arre  I'm not very technical, and trying to work out what is going on, as opposed to spending thousands of dollars to upgrade to a 100 user licence, is problematic.  This feature would greatly ease that process.

            Simon Hedges added a comment - I currently have 47 users on my 50 user licence, and Confluence thinks I have 53, but won't tell me who they arre  I'm not very technical, and trying to work out what is going on, as opposed to spending thousands of dollars to upgrade to a 100 user licence, is problematic.  This feature would greatly ease that process.

            Thanks for your interest in this issue.

            This request is considered a potential addition to our longer-term roadmap.
            We'll typically review this request in about 12 months time, at which point we’ll consider whether we need to alter its status.

            Cheers,

            Confluence Product Management

            Adam Barnes (Inactive) added a comment - Thanks for your interest in this issue. This request is considered a potential addition to our longer-term roadmap. We'll typically review this request in about 12 months time, at which point we’ll consider whether we need to alter its status. Cheers, Confluence Product Management

              3a5d08b54945 Mauricio Franzoni (Inactive)
              rbueno Renata Bueno
              Votes:
              454 Vote for this issue
              Watchers:
              196 Start watching this issue

                Created:
                Updated:
                Resolved: