How do I find "unlicensed" users for my Bitbucket Server instance?

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

Problem

Unlicensed users are ones that are in Bitbucket user database, created locally or synchronized from external user directories, and which do not have access to Bitbucket Server on the Global Permissions page either:

  1. Directly via username
  2. Via a group which the user is part of

Resolution

Run the following query against the database:

SELECT name 
FROM sta_normal_user 
WHERE NOT EXISTS (
    SELECT * FROM sta_global_permission WHERE user_id = sta_normal_user.user_id
) 
AND NOT EXISTS (
    SELECT * FROM cwd_membership WHERE parent_name IN (
        SELECT group_name FROM sta_global_permission
    )
    AND child_name = sta_normal_user.name
);

The plugin is locked down to administrators but it can be uninstalled from the Manage Plugins screen if preferred.

Description

There may be a need to list unlicensed users to either:

  1. Delete/remove them permanently from Bitbucket
  2. Grant access


Last modified on Jan 30, 2020

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.