Hello,
I need to get users which are not active in database. On the column cwd_user.active I got a user with 1 value even though is not active on application. He can not login. Why he has this 1 value?
I made the following for active user: But i need a query also for active with not acces on jira
SELECT DISTINCT cwd_user.lower_user_name,cwd_user.lower_first_name,cwd_user.last_name,cwd_user.created_date,cwd_user.updated_date,cwd_user.active AS user_status,
GROUP_CONCAT(cwd_membership.parent_name) AS GRUPURI
FROM cwd_user
JOIN cwd_membership
ON cwd_user.id = cwd_membership.child_id
AND cwd_user.directory_id = cwd_membership.directory_id
JOIN licenserolesgroup
ON Lower(cwd_membership.parent_name) = Lower(licenserolesgroup.group_id)
JOIN cwd_directory
ON cwd_membership.directory_id = cwd_directory.id
WHERE
cwd_directory.active = '1'
AND
cwd_user.active = '1' and
license_role_name = 'jira-software'
GROUP BY cwd_user.user_name
I'm afraid it's a bit more complex that the SQL you've generated here. And it's even harder because you cannot search for a negative - people who do not have access may not be in your database in a way you can recognise or report on.
Take your "can not log in" - what application access does that person have? The 1 means a potentially active account, but that's not the only thing that says they can log in. They could be being rejected in one of several ways.
You need something more understanding of the data than SQL if you really want this sort of report, but I'd actually skip it.
Why are you looking for users who have no access? They can't log in, they don't count towards your licences, and there's not really any reason to just simply ignore them that I can think of (until you hook your system up to a directory system with a very large number of people you don't need to know about and forget to restrict the range, but that's a cleaning up exercise)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.