Active Directory LastLogon and LastLogonTimestamp Attributes Do Not Reflect Properly in Okta
Last Updated:
Overview
Active Directory (AD) attributes lastLogon and lastLogonTimestamp do not reflect accurately in Okta. This occurs because AD handles replication for these attributes differently across Domain Controllers (DCs), and Okta imports the value only from the specific DC that the Okta AD Agent connects to during the import. Administrators must avoid importing these attributes into Okta to prevent inaccurate data representation.
Applies To
- Okta Identity Engine (OIE)
- Okta Classic Engine
- Active Directory (AD) Integration
Cause
AD does not replicate the lastLogon attribute between DCs. It updates the attribute only on the specific DC that authenticates the user. The lastLogonTimestamp attribute replicates across DCs but only updates every 9 to 14 days. Okta AD Agents connect to different DCs during authentication events and imports. Consequently, Okta imports only the lastLogon value stored on the specific DC that the agent connects to during the most recent import.
Solution
Why does Okta recommend against importing these attributes?
Okta recommends against importing the lastLogon and lastLogonTimestamp attributes. Because Okta cannot quickly identify which DC provided the lastLogon attribute during an import, the displayed value often misleads administrators.
AD attribute replication behavior explains the data discrepancy.
Review the differences in update frequency and replication behavior between the two AD logon attributes to understand their primary use cases.
lastLogon: AD updates this attribute instantly upon successful authentication, but it does not replicate the value between DCs. Finding a true last logon time requires querying every DC in the domain. This attribute provides real-time auditing or forensics.lastLogonTimestamp: AD replicates this attribute to all DCs, but it only updates the value if the current date is older than the stored date by a specific interval (typically 9 to 14 days). This attribute identifies inactive or stale accounts rather than providing real-time tracking.
