Get users last login date

im looking for an app or cli command to get all users access to nextcloud in the last month in a report or list with user ID and date.


You can use occ user:lastseen <user> to see information about the last login of a user. With a small script which loops through the user list you could fetch this information for all users.
You can also activate the admin_audit which allows to enable a separate audit log from which you can fetch more information.

Read also

Number of active users over time

I tried the “`occ user:lastseen ”```

But I need that log for all users logged in for the last month.







You can use occ user:list to get the list of the available users and the rest should be an easy task.

Do you know feature of normal userlist (/index.php/settings/users) and activate “show last login” in Settings (at the left bottom corner)? Then normal userlist shows it and you can sort it by last login date: