How to retrieve user's last login information using Confluence Command Line Interface(CLI)

This article explains how to retrieve the last login information of a user or user group using Confluence Command Line Interface (CLI).

Instructions

Use the getUser action to display the user statistics in general, using CLI action. 

To retrieve the last login information for single user:

Execute the below action to display a specific user's latest login details using the name parameter:

--action getUser --name admin

The login information of a given user is displayed as highlighted in the screenshot below:

Execute the below action to display a specific user details using userId parameter:

--action getUser --userID admin2

To retrieve the last login information of the current user who is executing the CLI action:

Execute the below action to display the logged in user's latest login details:

--action getUser

To retrieve the login information of the users of a specific group:

Execute the below action using getUserList to display the latest login information of all the users belonging to the confluence-users group:

--action runFromUserList --group "confluence-users" --common "-a getUser --userId @userId@"

To retrieve the latest login information of all users:

Execute the below action to display the latest login information of all the users with the runFromUserList action:

--action runFromUserList --name "@all" --common "-a getUser --userId @userId@"

The parameters used in the above actions are:

  • --nameThe value defines the name of the user.
  • --userId: The value defines the user Id of the user.
  • --group: The value defines the group name.
  • --file: The value defines the contents to the file path