Collection which stores last login date_time for the users
Are you please able to store the last login date_time for the users which exist either in admin database or $external database in a collection of admin database of that cluster or opsmanager database which manages the clusters?
I have a requirement at my end - is to find the users who havent logged in for 60 days, , their roles to be revoked. And, ultimately delete the users who dont have any roles attached after a fixed period of time.
I do undertsnad you store the login details in audit logs. But that would be a tedious process at our end, to write a code which parses the audit log files and then maintains our own (duplicate) collection of users and updates it with the last login time information as obtained from the audit logs. Thereafter, compare this collection with the collection in system.users of admin database or $external database to see the users who havent logged in for a while.