The LastLogonDate
attribute in Active Directory (AD) is not updated every time a user or a service running under a user account logs on to the domain. The decision to update the value is based on a formula: the current date minus the value of the ms-DS-Logon-Time-Sync-Interval
attribute minus a random percentage of 5. If the result is equal to or greater than LastLogonDate
, the attribute is updated.
For example, if a service is running under a user account and has been running for 6 months without a reboot, the LastLogonDate
for that user might show as 6 months ago. This is because the service might still have a valid Kerberos Ticket Granting Ticket (TGT) on the machine, and a new TGT does not necessarily trigger an update to the LastLogonDate
So, if a user account is used for anything (like running a service or logging into an email), it might not necessarily update the LastLogonDate
. It’s important to note that this attribute is designed to help identify inactive accounts for potential disablement, not to track each and every logon event
If you need more precise logon tracking, you might want to consider using audit logs or third-party solutions designed for this purpose.