Active Directory records two properties that store the last logon time:
The lastLogonTimeStamp attribute is updated sporadically and is therefore only accurate to about 14 days. This data is replicated to all DNS servers. This is particularly useful for finding dormant accounts that haven’t been used in months.
The lastLogon attribute is updated at every logon but it is not replicated and will therefore only be accurate if every DNS server is checked. This is useful for finding the latest logon for an account.