HEBook a call
Book a callHE
Blog

Microsoft 365 account compromised: what to do in the first hours

1 November 2026 · Shlomi Fanan

Threats

When an account is compromised, the order of your steps matters as much as speed. A password reset alone doesn’t lock the attacker out.

This guide is based on Microsoft’s playbooks and on our work in Microsoft 365 security projects.

Signs that something happened

Step 1: contain the account, in order

  1. Disable the account. This is Microsoft’s first recommendation: while the account is disabled, nobody can sign in again.
  2. Reset the password. For accounts synced from on-premises Active Directory, Microsoft recommends resetting it twice. Note that a password reset doesn’t revoke app passwords; delete those separately.
  3. Revoke all sessions. A password reset alone doesn’t lock the attacker out: a token already issued can work for up to about an hour. In apps that support continuous access evaluation, such as Exchange, SharePoint and Teams, revocation usually takes effect within minutes.
  4. Remove what the attacker added. Authentication methods and devices the user doesn’t recognize, and admin roles the account shouldn’t have.
  5. Share the new password through another channel. Not by email: the attacker may still be reading the mailbox.

Step 2: find what the attacker left behind

Attackers rarely settle for one way in. They leave ways back, or ways to keep receiving mail after the account is closed:

Three quick checks in PowerShell:

# Inbox rules, including hidden ones
Get-InboxRule -Mailbox user@contoso.com -IncludeHidden

# Forwarding set on the mailbox
Get-Mailbox user@contoso.com | Format-List Forwarding*Address,DeliverTo*

# Revoke all sign-in sessions (Microsoft Graph PowerShell)
Revoke-MgUserSignInSession -UserId user@contoso.com

Step 3: understand what was exposed

ToolWhat it gives youNote
Audit in Microsoft PurviewWho did what and when: sign-ins, file access, mailbox changesOn by default; check nobody turned it off. Records are kept 180 days, one year with Audit (Premium)
MailItemsAccessedWhich messages the attacker opened or syncedIncluded in Audit (Standard) for E3 and E5 users
Message traceHow many messages left the account, and to whomAlso what you use to notify recipients
Microsoft DefenderThe full incident, with related alerts across email, identity and devicesWith automatic attack disruption, Defender may already have contained part of the attack
Entra ID ProtectionRisky users and risky sign-insDismissing the risk doesn’t secure the account. Mark the user Confirm compromised, then reset the password; the reset is what clears the risk

Step 4: clean up and report

After the incident: close the door

This guide summarizes Microsoft’s recommendations. It isn’t legal advice about your organization’s reporting duties.

A security incident in Microsoft 365? At OnCloud we handle incidents like this: we contain it, investigate and close the gap. And if it hasn’t happened yet, we’ll help you prepare the environment and the plan in advance.

Contact us

Sources