igormartini.cloud

June 22, 2026 • IAM

AD vs Entra ID: Which Last Sign-In attribute should you trust?

🌐 Prefer reading in Portuguese 🇧🇷, use the language selector. You can also switch between Light ☀️ and Dark 🌙 modes anytime using the toggle in the top-right corner.

Overview

Have you ever been asked by an auditor, manager, or security team a seemingly simple question:

❓ When was this user last active?
❓ Which Active Directory attribute should you trust when investigating user activity?
❓ Is LastLogonDate really the most accurate option?
❓ Can LastSignInDateTime be used to determine whether a cloud account was actually used?
❓ And in hybrid environments, how can administrators confidently identify a user’s last known activity?

These are common questions for identity and security administrators, yet the answer is often misunderstood.

Active Directory and Microsoft Entra ID track user activity using different attributes, update mechanisms, and replication behaviors. As a result, the answer is often more complex than simply checking a single attribute.

Understanding these differences is essential for making informed operational, security, and audit-related decisions. This article explores the most commonly used sign-in attributes, explains their strengths and limitations, and presents a practical approach for accurately identifying user activity across hybrid identity environments.

Why This Matters

Accurate sign-in information impacts security investigations, account lifecycle management, licensing optimization, and compliance initiatives.

Real-World Scenario

⚠️ The scenario below is based on a real incident that I was involved in while supporting a hybrid identity environment.

A group of contractor accounts was incorrectly classified as inactive and disabled after an access review relied solely on Active Directory sign-in data. The subsequent investigation revealed that the users were actively accessing cloud-only resources through Microsoft Entra ID.

This example highlights how relying on a single attribute or identity source can lead to incorrect conclusions and unnecessary business disruption.

Key Concepts

In a hybrid identity environment, user activity may occur both on-premises and in the cloud.

📝 Note

Because each platform records activity differently, a single attribute rarely provides the complete picture.

AttributeReplicatedDescriptionBest Use Case
LastLogonNoUpdated only on the Domain Controller that authenticated the user. This attribute is not replicated between Domain Controllers. To determine the actual last logon, every Domain Controller must be queried and compared.Security investigations and accurate logon analysis
LastLogonTimestampYesReplicated version of LastLogon. Primarily designed to identify stale accounts. Updated according to the domain attribute ms-DS-Logon-Time-Sync-Interval, which defaults to approximately 14 days when not configured.Inactive account reporting
LastLogonDateCalculatedHuman-readable PowerShell conversion of LastLogonTimestamp. It is not a native Active Directory attribute and is not replicated. Instead, it is calculated locally from the replicated LastLogonTimestamp value.Administrative reporting and quick searches
AttributeDescriptionBest Use Case
LastSignInDateTimeTimestamp of the last interactive sign-in attempt. The sign-in may be successful or unsuccessful (for example, a failed MFA challenge).Authentication troubleshooting
LastSuccessfulSignInDateTimeTimestamp of the last successful sign-in, including both interactive and non-interactive authentication events.Most accurate indicator of cloud account activity
LastNonInteractiveSignInDateTimeTimestamp of the last non-interactive sign-in attempt. The sign-in may be successful or unsuccessful and is typically generated by applications or services acting on behalf of the user.Identifying application-based activity and supporting inactive account analysis.
⚠️ Important

LastLogonDate and LastSignInDateTime are frequently used by administrators, but they do not always represent the most accurate indication of user activity.

Common MistakeImpact
Using LastLogonDate as the sole source of truth.Cloud-only activity may be missed.
Assuming LastSignInDateTime always represents successful activity.Failed authentication attempts may lead to incorrect conclusions.
Evaluating only Active Directory data.Active cloud users may be incorrectly classified as inactive.

Recommended Approach

The workflow below provides the most accurate method for determining user activity in hybrid identity environments.

💡 Pro Tip

Compare LastLogon from all Domain Controllers with LastSuccessfulSignInDateTime from Microsoft Entra ID.

The following HTML report was generated using the Hybrid_LastKnownActivity_Report.ps1 PowerShell script, which is available for download on GitHub.

Determining a user’s last activity is more complex than reviewing a single attribute.

While Active Directory and Microsoft Entra ID both provide valuable sign-in information, each platform records and maintains activity differently.

Microsoft identifies LastLogon as the most accurate on-premises logon attribute and LastSuccessfulSignInDateTime as the most reliable indicator of successful cloud activity.

In hybrid environments, correlating both data sources can help administrators build a more complete view of user activity and make more informed operational and security decisions.

If you found this content useful, feel free to share your thoughts on LinkedIn and share this article with others who may benefit from it.

References

Microsoft. signInActivity resource type. Microsoft Learn. Available at: https://learn.microsoft.com/en-us/graph/api/resources/signinactivity?view=graph-rest-1.0

Microsoft. Understanding the AD Account Attributes – LastLogon, LastLogonTimeStamp and LastLogonDate. Microsoft TechNet Wiki. Available at: https://learn.microsoft.com/en-us/archive/technet-wiki/22461.understanding-the-ad-account-attributes-lastlogon-lastlogontimestamp-and-lastlogondate

Discover more from igormartini.cloud

Subscribe now to keep reading and get access to the full archive.

Continue reading