How to find the list of all users in Gitlab EE and their last used date via command?

How to list out all users of Gitlab and their last used date via command? Please help

echo "select name,last_sign_in_at from users" | gitlab-psql -d gitlabhq_production        
     name      | last_sign_in_at 
---------------+-----------------
 Administrator | 
(1 row)
1 Like

Hi,

next to the database command you could also write a small script which extracts the last_sign_in_at attribute from the received users via the REST API.

https://docs.gitlab.com/ee/api/users.html#for-admins

Cheers,
Michael