Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to find last login for users using SQL?

Marc Richter November 5, 2020

Since the Confluence DC REST API is not capable of anything useful, I already realized that I need to do most stuff using SQL.

What I'm currently struggling with is to get the "Last Login" datetime of a user from the DB. Confluence stores this info somewhere, since it displays the correct information in /admin/users/viewuser.action, but I can't find that record in the DB.
I read it multiple times that this info should be in table 'cwd_user_attribute', but there seem to be only records from local user directories, such as the "Confluence Internal Directory", for example. Our users are from a "Atlassian Crowd" Directory (which is configured to use our JIRA instance as Crowd server).

Where can I extract these login times from using SQL? Do I have to look it up in Jira, or is it stored in the Confluence DB but elsewhere?

1 answer

0 votes
Fabian Lim
Community Champion
December 27, 2021

Hi @Marc Richter

We actually use scriptrunner to determine who hasn't logged in for a period of time and we disable them. Look at this sample: https://scriptrunner.adaptavist.com/5.0.8/confluence/ScriptConsole.html

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events