By default OpenLDAP does not record a last logon, nor AFAIK any or similar data that you can use/abuse to find inactive accounts.
But you can extend OpenLDAP with the lastbind overlay and then it will provide a authTimestamp
attribute:
The lastbind overlay to slapd(8) allows recording the timestamp of the last successful
bind to entries in the directory, in the authTimestamp attribute. The overlay can be
configured to update this timestamp only if it is older than a given value, thus avoiding
large numbers of write operations penalizing performance. One sample use for this overlay
would be to detect unused accounts.
Install the overlay, edit slapd.conf and restart OpenLDAP
# ETCDIR/slapd.conf
# ...
overlay lastbind
lastbind-precision 68400
IIRC there are some caveats as for example the authTimestamp
attribute appears to be specific to a particular OpenLDAP server and is excluded from replication. Any reports will then need to query all your OpenLDAP servers to find the most recent last logon date.
Once enabled you will need to create a script that finds accounts whose authTimestamp
exceeds your idea of too long ago since last successful logon and lock them.