Skip to content
Visual explainer 4h to learn 5 steps

Capstone: fix a denied sign-in and offboard a user

Diagnose and fix a denied sign-in with minimum privilege, then offboard a test user and document the handover.

By Invicly Tech, , in Microsoft Entra & Microsoft 365 Administration. About 13 minutes to read.

Topic 31 of 31

In short

The last milestone is a realistic bad day: a test user is denied sign-in, and later another test user leaves. You read the sign-in log to find the cause, fix it with the smallest change and the lowest role that can make it, then offboard the leaver across Entra ID, Exchange Online, Teams, SharePoint and OneDrive and Intune, verify each service and write a handover note.

Think of it like this: Like a mechanic, you read the warning code before touching anything, fix the one part that failed, and hand the owner a written note of what was done.

Explained simply

On Monday morning cara.test says she cannot open Outlook. The error page shows a code and a correlation ID. Your job is to find out why, fix it properly and prove it is fixed, without giving her more access than she needs.

Open the sign-in logs and find her entry using the time or the correlation ID. Look at three things: the error code, the Conditional Access tab and the device details. Error 53003 means a Conditional Access policy blocked her. If the device shows as not compliant, the policy did its job and the real problem is the device.

Fix the cause with the smallest change and the lowest role that can make it. If her laptop is missing a required update, fix the laptop and let Intune re-check it. Do not exclude her from the policy, and do not make her an admin to get her working.

Later that week ben.test leaves the company. Offboarding means blocking access, handing over his mail and files to his manager, transferring his Team ownership, removing his device from management and finally removing licences. Check each service on its own, then write a short handover note.

If you have no tenant, do the same work with a synthetic sign-in log and mock user data. The diagnosis and the checklist are the parts that matter.

Press Play on a diagram to walk through it one step at a time.

FlowFrom denied sign-in to verified fix
  1. 1
    Collect

    User, time, app, correlation ID

  2. 2
    Read the log

    Error code, CA result, device state

  3. 3
    Find the cause

    Policy, MFA failure or compliance

  4. 4
    Smallest fix

    Lowest role, narrowest change

  5. 5
    Verify

    User signs in; log shows success

  6. 6
    Record

    Ticket notes and rollback

MapOffboarding touches every service
Leaver ben.test
  • Entra ID
    • Block sign-in
    • Revoke sessions
    • Remove groups and roles
  • Exchange Online
    • Convert to shared mailbox
    • Grant manager access
    • Set auto-reply
  • Teams
    • Transfer team ownership
    • Check owned chats and meetings
  • SharePoint and OneDrive
    • Give manager OneDrive access
    • Reassign site ownership
  • Intune
    • Retire or wipe devices
    • Confirm device removed
SequenceFixing cara.test's denied sign-in
cara.test
Help desk
Intune
Entra ID
  1. 1Sign in to Outlook from laptop
    cara.test to Entra ID: Sign in to Outlook from laptop
  2. 2Blocked: 53003, CA02 requires compliant device
    Entra ID to cara.test: Blocked: 53003, CA02 requires compliant device
  3. 3Ticket with correlation ID
    cara.test to Help desk: Ticket with correlation ID
  4. 4Check device: BitLocker off, non-compliant
    Help desk to Intune: Check device: BitLocker off, non-compliant
  5. 5Turn on BitLocker, then Sync in Company Portal
    Help desk to cara.test: Turn on BitLocker, then Sync in Company Portal
  6. 6Device reported compliant
    Intune to Entra ID: Device reported compliant
  7. 7Sign in again: success, CA02 Success
    cara.test to Entra ID: Sign in again: success, CA02 Success

In depth

Reading a denied sign-in

Gather the facts first: user, approximate time, app, device and the correlation ID from the error page. In the sign-in logs, filter by user and time, then open the failed entry. Common codes are 50126 (wrong username or password), 50053 (account locked), 50057 (account disabled), 500121 (MFA step failed or not completed), 53000 (device not compliant or not managed for a policy that requires it) and 53003 (blocked by Conditional Access).

The Conditional Access tab lists each policy with Success, Failure, Not applied or a report-only result. The policy with Failure is your lead. The Device info section shows whether the device is Entra joined, managed and compliant. Together they usually point to one cause: the user, the method, the device or the policy design.

  • 53003: blocked by Conditional Access
  • 53000: device compliance required
  • 500121: MFA not completed
  • 50057: account disabled
  • Correlation ID matches the log entry
CompareThree causes, three different fixes
Policy match
  • Error 53003, a policy shows Failure
  • Check assignments and conditions
  • Fix: correct the policy scope if it is wrong
  • Role: Conditional Access Administrator
MFA failure
  • Error 500121
  • User lost phone or denied prompt
  • Fix: Temporary Access Pass, re-register method
  • Role: Authentication Administrator
Device compliance
  • isCompliant false in Device info
  • Intune shows the failing setting
  • Fix: remediate device, re-check compliance
  • Role: Intune Administrator

Fixing with minimum privilege

Use the service map from milestone one to choose the least role that can make the fix, and activate it only for the task if PIM is available. A device problem is an Intune task; a lost authenticator is an Authentication Administrator task for a non-admin user; only a genuine policy design error should change Conditional Access, and that change should be reviewed by a second person.

Avoid the shortcuts. Excluding the user from the policy removes protection permanently and is easy to forget. Turning the policy to report-only for everyone hides the problem across the company. If an emergency exception is truly needed, add the user to a named exception group with an end date and an owner, record it, and remove it once the cause is fixed.

  • Pick the role from the service map
  • Second-person review for policy changes
  • No permanent exclusions
  • Time-boxed exception group if unavoidable

Verifying the fix

A fix is not finished until you see it in the evidence. Ask the user to sign in again and find the new log entry: status success, the same policy now showing Success, and the device marked compliant. In Intune, the device's compliance status should read Compliant with a recent check-in time.

Save the before and after entries side by side. If the policy itself changed, also save the Entra audit log entry for the update, which shows who changed what and when. These three records, failure, change and success, are the core of the incident evidence pack.

  • New log entry shows success
  • Same policy now Success
  • Audit log shows any policy change
  • Before, change, after side by side

Safe offboarding across services

Follow the joiner, mover, leaver checklist. Entra ID: block sign-in, revoke sessions, record and remove group memberships and roles, remove authentication methods if the device is lost. Exchange Online: convert the mailbox to shared and grant the manager Full Access, or set forwarding if policy allows, and add an auto-reply; a shared mailbox up to 50 GB needs no licence. Teams: transfer ownership of any team where ben.test is the only owner. SharePoint and OneDrive: give the manager access to the OneDrive and reassign site ownership; OneDrive is kept for the retention period after deletion, 30 days by default. Intune: retire a personal device or wipe a company one.

Only after mail and files are handled, remove the licence by removing the group. Delete the account at the end of your retention period.

FlowLeaver order of operations
  1. 1
    Block and revoke

    Entra ID

  2. 2
    Record access

    Groups, roles, owned Teams and sites

  3. 3
    Hand over data

    Shared mailbox, OneDrive access, owners

  4. 4
    Retire or wipe devices

    Intune

  5. 5
    Remove licence

    Group removal after data is safe

  6. 6
    Delete later

    After retention period

Writing the handover

The handover note is for the manager and the next admin. Keep it to one page. Include: who left and when; what was blocked and when; where mail now lives and who can open it; where files now live and for how long; which Teams and sites changed owner; what happened to each device; which licences were freed; the inventory file location; and how to reverse each step if the departure is cancelled.

Add the verification results per service with a timestamp, and any open items, such as a shared password the leaver knew that must be rotated. Close the ticket only when every service shows a pass.

  • Who, when, what was blocked
  • Mail, files, Teams, sites, devices
  • Licences freed
  • Rollback steps and inventory location
  • Open items and owners

Learn it in 5 short steps

About 50m each. Track them with a timer in your plan.

  1. 1
    Diagnose the denied sign-in~50m
  2. 2
    Fix it with minimum privilege~50m
  3. 3
    Offboard a test user~50m
  4. 4
    Verify every service~50m
  5. 5
    Write the handover~50m

Key points

  • Start from the sign-in log entry, not from a guess: the error code and Conditional Access tab usually name the cause.
  • Fix with the least privilege: a Conditional Access Administrator edits policies, an Authentication Administrator resets methods for non-admins.
  • Never fix a denial by excluding the user from all policies or by making them an admin.
  • Verify each service separately after offboarding; one green check in Entra does not prove the mailbox or device is handled.
  • The handover note lists what was changed, where data now lives, who owns it and how to reverse it.

Key terms

Tap a card to flip it. 0/5 known

Examples

json
{
  "userPrincipalName": "cara.test@contoso.example",
  "createdDateTime": "2026-11-24T08:12:44Z",
  "appDisplayName": "Office 365 Exchange Online",
  "status": { "errorCode": 53003, "failureReason": "Access has been blocked by Conditional Access policies." },
  "conditionalAccessStatus": "failure",
  "deviceDetail": { "operatingSystem": "Windows", "isCompliant": false, "isManaged": true },
  "appliedConditionalAccessPolicies": [
    { "displayName": "CA02 Require compliant device for staff", "result": "failure" }
  ]
}

A synthetic sign-in record: CA02 blocked the user because the device is not compliant.

Triage a synthetic sign-in log

The script reads synthetic failures and suggests the likely owner of the fix. It does not change anything. Expected evidence: a list of failed sign-ins with a cause and the team that should act.

powershell
$map = @{ 53003='Conditional Access: check failed policy'; 53000='Intune: device compliance'
          500121='Auth methods: MFA not completed'; 50057='Entra: account disabled'
          50126='User: wrong password'; 50053='Entra: account locked' }
$log = (Get-Content .\signins.json | ConvertFrom-Json).value
$log | Where-Object { $_.status.errorCode -ne 0 } | ForEach-Object {
  $code = [int]$_.status.errorCode
  $failed = ($_.appliedConditionalAccessPolicies | Where-Object result -eq 'failure').displayName
  [pscustomobject]@{ User=$_.userPrincipalName; Code=$code
    Cause= $map[$code] ?? 'Look up code'; Policy=$failed -join '; '
    Compliant=$_.deviceDetail.isCompliant }
} | Format-Table -AutoSize

Offboarding ben.test with service checks

The Entra steps reuse the offboarding function from the automation module; the mail step uses Exchange Online PowerShell. After running, verify each service: Get-MgUser shows AccountEnabled False; Get-EXOMailbox shows RecipientTypeDetails SharedMailbox; Teams admin center shows a new owner for Finance Team; the manager opens ben.test's OneDrive link; Intune shows the device as retired. Then remove the licence group and write the handover.

powershell
Disable-IvLeaver -UserId $benId -WhatIf     # review plan, then run without -WhatIf
Connect-ExchangeOnline
Set-Mailbox -Identity ben.test@contoso.example -Type Shared
Add-MailboxPermission -Identity ben.test@contoso.example `
  -User mia.manager@contoso.example -AccessRights FullAccess -AutoMapping $true
Set-MailboxAutoReplyConfiguration -Identity ben.test@contoso.example `
  -AutoReplyState Enabled -InternalMessage 'Ben has left. Please contact Mia.'
Get-EXOMailbox -Identity ben.test@contoso.example | Select-Object RecipientTypeDetails
Disconnect-ExchangeOnline -Confirm:$false

Quick reference

  • Start with the log: error code, Conditional Access tab, device info, correlation ID.
  • 53003 = blocked by CA; 53000 = compliance required; 500121 = MFA not completed.
  • Fix the cause, not the policy: device issues are Intune tasks.
  • No permanent exclusions; use a time-boxed exception group with an owner.
  • Leaver order: block, revoke, record, hand over, retire device, unlicense, delete later.
  • Shared mailbox up to 50 GB needs no licence; convert before removing the licence.
  • Transfer Teams ownership before the leaver's account is deleted.
  • Optional follow-ons: SC-300 and MD-102. MS-102 retired 30 Nov 2026; check AB-650.

Common mistakes

  • Excluding the user from the policy to make the ticket go away, which removes protection for good.
  • Deleting the leaver on day one, before mail and files are handed over.
  • Checking only Entra ID and forgetting the phone still holds company mail.

Quick quiz

Pick an answer to see if you're right and why.

Question 1

1A sign-in shows 53003 and the compliant-device policy as Failure. The device is non-compliant because BitLocker is off. What is the right fix?

Question 2

2A user lost their phone and gets error 500121. Who should fix it, with which step?

Question 3

3Why convert the leaver's mailbox to shared before removing the licence?

Question 4

4Which record proves a Conditional Access policy was changed during the incident?

0/4 answered

Practice exercises

Try each one yourself first. Use the hint if you get stuck, then compare with the solution.

  1. Exercise 1easy

    Given a synthetic entry with errorCode 50057, state the cause, the role to fix it and how to verify.

  2. Exercise 2medium

    Write the joiner, mover, leaver checklist for Contoso covering Entra ID, Exchange Online, Teams, SharePoint and OneDrive, and Intune.

  3. Exercise 3hard

    Write the handover note for ben.test's departure, including rollback.

Check yourself

Answer in your head, reveal, then be honest with yourself.

Feel confident about this topic?

Frequently asked questions

Should I ever exclude a user from Conditional Access to fix a ticket?
Only as a short, recorded exception through a named group with an owner and end date. Fix the underlying cause and remove the exception.
What is the difference between retire and wipe in Intune?
Retire removes company data, apps and management from the device but keeps personal data. Wipe resets the device to factory settings, which suits company-owned devices.
How long can I restore a deleted user?
Deleted users stay in the Entra recycle bin for 30 days and can be restored with their group memberships in that time. After that they are gone for good.
Which certifications fit after this capstone?
Optional follow-ons are SC-300 for identity and MD-102 for endpoints, both active when this was written. MS-102 retired on 30 November 2026, and Microsoft points to AB-650 as its successor, so check learn.microsoft.com/credentials for current status first.

Go deeper

ShareXLinkedInWhatsApp