Retrieve the timestamp of a user’s last login

Article ID:360029396412
1 minute readKnowledge base

Issue

As a CloudBees Core administrator you would like to get a summary of the user activity

Resolution

At the time of writing this KB article, the only way to achieve this goal is through the User Activity Monitoring Plugin. The User Activity Monitoring plugin helps you understand licensing and entitlement. It provides you with a summary of user activity, CSV exports of user access details, and JSON reports that can be exported to other applications.

The User Activity Monitoring dashboard summarizes the user activity after the date of the plugin’s installation, with a data retention policy of one calendar year.

FIRST_DAY_OF_WEEK   NAME    LAST_SEEN
2020-01-020  fbelzunc   2020-01-20 13:22:32.435

There is also a well known script called get-lastlogin-users.groovy, but the report might not include what you are expecting to since thetimestamp is not the date of the last login, but the last time granted authorities changed, e.g., user group. If LastGrantedAuthoritiesProperty was never changed since the first time an user made login in the instance, the script will return the first time the user made login, instead of the last time. You should not rely on this script if you are auditing your instance.