MSBA-202 · Lesson 11 of 12 · 19 min

Sign-in logs and troubleshooting access

▶ Video coming soon A video version of this lesson is on the way.

At 6:52 on a Monday morning the help desk phone rang. A personal support worker named Josie was in her car outside a client's home in a rural part of the county, and the visit app would not open. Ama took the call, and within four minutes she had the answer. Josie's old work phone had been replaced on Friday, her passkey had lived on the old phone, and every sign-in on the new one stopped at the MFA step because she had no method registered on it. Ama verified Josie on a video call against her staff photo, issued a one-hour, one-time Temporary Access Pass, and stayed on the line while Josie registered a new passkey in Authenticator. Josie was at the door by seven. Ama had not guessed. She had opened Josie's latest sign-in in the sign-in logs, read the failure reason, and clicked the Authentication details tab to see exactly which step had failed.

Every lesson so far has added controls. Controls create friction, and friction creates calls. This lesson is about the tools that turn "it doesn't work" into a precise cause: the sign-in and audit logs, error codes, Conditional Access details, the What If tool, and the export of logs for longer retention and analysis. These skills appear directly in the AB-650 objective "Investigate and resolve authentication issues".

The sign-in logs

The sign-in logs in the Microsoft Entra admin center (Entra ID > Monitoring & health > Sign-in logs) record every authentication to the tenant. They are split into several views:

Log viewRecordsExample
Interactive user sign-insSign-ins where the user provided a factor such as a password, passkey or MFA responseJosie signing in to the visit app
Non-interactive user sign-insSign-ins a client made on the user's behalf using tokens, without user inputOutlook refreshing its token in the background
Service principal sign-insApps and services signing in as themselvesThe HR integration's nightly run
Managed identity sign-insAzure resources signing in with managed identitiesThe licence report runbook

Agent activity appears too, as agent identities and agent users sign in; the exact views evolve as Agent ID matures, so check the current filters in the portal. Each entry has a status (success, failure or interrupted), a timestamp, the user or identity, the application and resource, the IP address and location, the client app, and a correlation ID and request ID that Microsoft Support asks for when a case is opened.

Opening an entry shows detailed tabs, and knowing what each tab answers saves most of the time in troubleshooting:

TabAnswers the question
Basic infoDid it succeed, and if not, what was the error code and failure reason?
LocationWhere did it come from (IP address, city, country), and was it a named location?
Device infoWhich device and operating system, and was it Entra joined, compliant and managed?
Authentication detailsWhich methods were used for each step, and did any step fail?
Conditional AccessWhich policies applied, which were satisfied, failed or not applied, and why?
Report-onlyWhat would report-only policies have done to this sign-in?

Retention is limited. Sign-in logs and audit logs are kept for 7 days in tenants with only Entra ID Free and 30 days with Entra ID P1 or P2. Many investigations, and most compliance requirements, need more than that, which is why exporting logs is a standard setup task.

Error codes worth knowing

Failed sign-ins carry an AADSTS error code (the prefix dates from the Azure AD name). A handful account for most help desk calls:

CodeMeaningUsual fix
AADSTS50126Invalid username or passwordUser retypes or resets the password with SSPR; repeated failures from elsewhere suggest password spraying
AADSTS50053Account locked, by smart lockout or because sign-ins came from a known malicious IPWait for the lockout to clear or investigate the source; do not simply unlock if the attempts were not the user
AADSTS50057Account disabledCheck whether the account should be enabled, for example after a leave of absence
AADSTS50076 and AADSTS50074Strong authentication (MFA) is requiredNormal prompt; a failure here usually means the user lacks a qualifying method
AADSTS53003Access blocked by Conditional AccessRead the Conditional Access tab to find the policy and the unmet condition
AADSTS53000Device must be managed or compliantFix the device's compliance in Intune or enroll it
AADSTS50105The user is not assigned to the applicationAssign the user or group, or request the access package
AADSTS65001Consent has not been granted for the appGrant admin consent or approve the admin consent request
AADSTS50011Redirect URI does not match the app registrationDeveloper fixes the app or the registration's redirect URIs

Error codes change slowly but do change, and the error code lookup at login.microsoftonline.com/error gives the current description for any code. Memorizing every code is unnecessary; recognizing the families (password, lockout, MFA, Conditional Access, device, assignment, consent, app configuration) and knowing which log tab to open next is the skill.

A decision tree. Start: find the sign-in in the logs. Did it fail at the first factor? If yes, check password, lockout or disabled account. If no, was it interrupted for MFA? If yes, check authentication details and registered methods. If no, did Conditional Access block it? If yes, open the Conditional Access tab and check device, location and risk. If no, check app assignment and consent. Each branch ends with a fix box.
A troubleshooting path. Most problems are found by asking, in order: first factor, MFA, Conditional Access, then the app.

Reading the Conditional Access tab

The Conditional Access tab lists every policy in the tenant with a result for this sign-in: Success (applied and satisfied), Failure (applied and not satisfied, which caused a block or an interruption), or Not applied (the sign-in did not match its assignments). Selecting a policy shows which assignments matched and which grant controls were or were not satisfied. When a block is unexpected, the details almost always show one of four causes: the device was not compliant or not recognized as joined; the location was not where the user thought (a mobile carrier routing traffic through another region, or a VPN); risk was raised; or the user was in a group they did not know about.

The What If tool from lesson 4 complements the logs. Logs show what happened; What If shows what would happen under changed conditions, which helps answer "if we exclude this group, will the nurses get through?" before the change is made. The Sign-in diagnostic, available from the help and support area of the admin center, takes a user and a time window, finds the relevant sign-ins and explains likely causes in plain language, which is useful for first-line staff.

Worked problem

An unexpected block

Felix tries to activate the Teams Administrator role from his home office and receives AADSTS53003. The Conditional Access tab shows CA006 (block outside Canada and the US) with result Failure, and the Location tab shows an IP address in another country. Felix is at home. What is happening, and what should Teodor do?

Show solution
  1. AADSTS53003 means a Conditional Access block, and the tab names CA006 as the cause.
  2. The Location tab shows a foreign IP, but Felix is home, so the traffic is not originating where it seems.
  3. Ask Felix whether he is using a VPN or privacy relay; personal VPN services often exit in other countries.
  4. Felix turns off his personal VPN, signs in again, and the sign-in succeeds; no policy change is needed.

Answer: His personal VPN exited abroad, so the country-block policy worked as designed. The fix is the user's network, not a policy exception.

Audit logs

The audit logs record changes rather than sign-ins: who created a user, who changed a Conditional Access policy, who added a member to a role-assignable group, who consented to an app, who reset a password. When a user says "my MFA method disappeared", the audit log shows whether an Authentication Administrator removed it. When an attacker is suspected, the audit log shows what they changed. PIM, access reviews and entitlement management add their own audit history on top.

Exporting and querying logs

For longer retention and analysis, Entra ID logs are exported through diagnostic settings to one or more destinations: a Log Analytics workspace (for queries and workbooks), an Azure Storage account (for cheap long-term archiving) or an Event Hub (for a third-party security information and event management tool). Microsoft Sentinel, Microsoft's cloud SIEM, uses a Log Analytics workspace, and Microsoft Defender XDR also draws on identity signals. Exporting requires an Azure subscription, and storage and ingestion costs depend on volume, so choosing which logs to export (for example, interactive and service principal sign-ins and audit logs, but perhaps not every non-interactive sign-in) is a cost decision as well as a technical one.

Once logs are in Log Analytics, the Kusto Query Language (KQL) makes questions quick to answer. Teodor kept a few saved queries for the help desk and for his monthly report.

Two KQL queries Teodor saved. ResultType 0 means success; 53003 is a Conditional Access block.
// Top failure reasons in the last 7 days (Log Analytics, SigninLogs table)
SigninLogs
| where TimeGenerated > ago(7d)
| where ResultType != "0"
| summarize Failures = count() by ResultType, ResultDescription
| top 10 by Failures

// Sign-ins blocked by Conditional Access, by policy
SigninLogs
| where TimeGenerated > ago(7d) and ResultType == "53003"
| mv-expand Policy = ConditionalAccessPolicies
| where Policy.result == "failure"
| summarize Blocks = count() by PolicyName = tostring(Policy.displayName)

Without Log Analytics, Microsoft Graph PowerShell can still read the logs within the retention period, which is enough for a quick check on one user.

A quick check from PowerShell. An error code of 0 means the sign-in succeeded.
# Last 10 sign-ins for one user, with status and Conditional Access result
Connect-MgGraph -Scopes "AuditLog.Read.All"
Get-MgAuditLogSignIn -Filter "userPrincipalName eq 'josie.marchand@corvallincare.example'" -Top 10 |
    Select-Object CreatedDateTime, AppDisplayName, @{n="Error";e={$_.Status.ErrorCode}},
        ConditionalAccessStatus, @{n="City";e={$_.Location.City}}

Building a troubleshooting routine

Ama turned what she had learned into a one-page routine for the help desk, and the call that opened this lesson was solved by following it. Find the user's most recent sign-in to the app in question. Read the error code and failure reason. Open the tab the code points to: Authentication details for MFA problems, Conditional Access for blocks, Device info for compliance, and the enterprise application's assignments for AADSTS50105. Fix the cause, not the symptom, and escalate to Teodor only when the fix would be a policy change. In the first quarter after the identity project, average handling time for sign-in calls fell from eleven minutes to five, and calls escalated to IT fell by two thirds.

Investigating a suspected compromise

Troubleshooting is usually about a user who cannot get in. Investigation is the opposite: someone may have got in who should not have. The same logs answer both, read differently. When the branch coordinator's account was phished in September 2026, Teodor followed a short sequence. He filtered the sign-in logs for the account over the past 30 days and looked for successful sign-ins from unfamiliar locations, IP addresses or devices, including non-interactive sign-ins, which reveal a stolen token being used quietly in the background. He opened the audit logs for the same account to see whether new MFA methods had been registered, app consents granted or the account added to groups. He checked the user's mailbox for new inbox rules in Exchange, a favourite trick for hiding replies from the real user. And he checked the enterprise applications list for consent grants by that user (lesson 9).

If the evidence shows compromise, the response steps are the same each time: confirm the user compromised in ID Protection (which raises risk and triggers policy), revoke the user's sessions, reset the password or require re-registration of methods, remove any methods, rules, consents or memberships the attacker added, and review what data the account accessed. Microsoft Defender XDR brings much of this into one incident view, but an administrator who knows the Entra logs can do it with nothing else.

QuestionWhere to look
Did someone sign in from somewhere unusual?Interactive and non-interactive sign-in logs, Location tab
Did they register a method or change the account?Audit logs, filtered by target user
Did they grant an app access?Audit logs (consent to application) and the enterprise application's permissions
Did they set up mail forwarding or rules?Exchange admin center or Defender portal
Is the account still at risk?ID Protection risky users report

Health and recommendations

Two further areas of the admin center help administrators notice problems before users call. Recommendations list improvements Microsoft has identified for the tenant, such as removing unused applications, renewing expiring credentials, migrating from per-user MFA or converting legacy policies, each with a status and the affected objects. Health monitoring tracks key authentication scenarios, such as MFA sign-ins and sign-ins to managed devices, and raises alerts when success rates drop sharply, which can reveal a broken policy or a service issue within minutes. Microsoft Entra also publishes service incidents in the Microsoft 365 Service health dashboard and the Azure status page. When many users fail at once, those pages are worth checking before anyone edits a policy.

Common mistakes

  • MistakeGuessing at the cause of a sign-in failure.

    InsteadOpen the sign-in entry and read the error code and the relevant tab.

  • MistakeLooking only at interactive sign-ins.

    InsteadBackground token use, apps and managed identities appear in the non-interactive, service principal and managed identity views.

  • MistakeRelying on the portal's default retention for investigations.

    InsteadExport logs to Log Analytics or storage; Free keeps 7 days and P1 or P2 keep 30.

  • MistakeAdding a policy exclusion to fix one user's block.

    InsteadFind the unmet condition, such as device compliance or a VPN, and fix that.

  • MistakeUnlocking an account locked by attempts from an unknown source.

    InsteadInvestigate the source first; the lockout may be stopping an attack.

Summary and key terms

  • Sign-in logs record interactive, non-interactive, service principal and managed identity sign-ins, with tabs for authentication, device, location and Conditional Access.
  • AADSTS error codes fall into families: password, lockout, MFA, Conditional Access, device, assignment, consent and app configuration.
  • The Conditional Access tab shows each policy as success, failure or not applied; What If tests changes before they are made.
  • Audit logs record changes, such as policy edits, role changes and consent grants.
  • Export logs with diagnostic settings to Log Analytics, storage or an Event Hub for retention beyond 7 or 30 days, and query them with KQL.
Sign-in log
The record of every authentication to the tenant, with its result and context.
Non-interactive sign-in
A sign-in a client performs with tokens on a user's behalf without user input.
Correlation ID
An identifier that links the events of one sign-in for troubleshooting and support cases.
Audit log
The record of changes made in the directory and its policies.
Diagnostic settings
Configuration that exports Entra logs to Log Analytics, storage or an Event Hub.
KQL
Kusto Query Language, used to query logs in Log Analytics and Microsoft Sentinel.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. A user receives AADSTS50105 opening an app. What is the likely cause?

    Show answer

    The app requires assignment and the user is not assigned.

  2. How long are sign-in logs kept in a tenant with Entra ID P1?

    Show answer

    30 days.

  3. Where would you look to find out who changed a Conditional Access policy yesterday?

    Show answer

    The Entra audit logs.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz