An account is not recovered when the password is reset; it is recovered when every foothold the attacker added has been found and removed. Attackers who take over a Microsoft 365 account rarely rely on the password alone. In the time they hold the session they can register their own MFA method, consent an app to read mail, add an inbox rule that hides replies, and keep a refresh token that outlives the reset. Each of those survives a password change.
This guide is a single sweep you can run on every recovered account in a Microsoft Entra ID and Exchange Online tenant. It works through five places persistence hides: sessions and tokens, authentication methods, OAuth app grants, inbox rules and forwarding, and devices. For each one it gives the documented Microsoft interface to check, what suspicious looks like and how to remove it. For the wider incident process (roles, triage, communications and review), use the Account Takeover Response Playbook. This page is the eradication checklist that sits inside it.
This is an independent guide from NHI Mgmt Group, based on Microsoft's public documentation as of November 2026. It is not sponsored or reviewed by Microsoft. Product features change, so confirm settings against Microsoft's current documentation.
Key takeaways
- A password reset does not remove registered MFA methods, OAuth consents, inbox rules, mail forwarding or device registrations. Each needs its own check.
- Revoke sign-in sessions first, so the attacker cannot add new persistence while you are removing the old.
- Microsoft Graph lists a user's authentication methods at
/users/{id}/authentication/methodsand their user-specific OAuth grants at/users/{id}/oauth2PermissionGrants. - Use
Get-InboxRule -Mailbox <user> -IncludeHiddenin Exchange Online PowerShell. Without the switch, hidden rules are not returned. - The per-user grant list excludes consents granted for all users in the organisation, so a tenant-wide grant made by a compromised administrator needs a separate check.
- Run the sweep on every confirmed account, record what you found, and recheck after a few days.
Why persistence survives recovery
Most account takeover recoveries follow the same steps: reset the password, tell the user, close the ticket. That sequence assumes the attacker's only access was the password. In practice, the attacker who signed in successfully had a working session, and a working session can change almost anything the user can change.
The common footholds map to well-known ATT&CK techniques:
| Foothold | What it gives the attacker | ATT&CK |
|---|---|---|
| Stolen refresh token or session cookie | Continued access without a password | T1528 Steal Application Access Token; T1550.004 Web Session Cookie |
| Attacker-registered MFA method | The ability to pass MFA after any password reset | T1098 Account Manipulation |
| Consented OAuth app | API access to mail and files that does not depend on the user's password | T1528 Steal Application Access Token |
| Inbox rule that forwards mail | A copy of incoming mail outside the organisation | T1114.003 Email Forwarding Rule |
| Inbox rule that moves or deletes mail | Hides security alerts and replies from the real user | T1564.008 Email Hiding Rules |
| Registered device | A device identity that may satisfy device-based conditions | T1098.005 Device Registration |
Because these sit in different services (Entra ID, Microsoft Graph, Exchange Online), no single screen shows them all. That is why a written sweep matters more than any one tool.
Before you start
Gather the following before you begin, so the sweep runs in one sitting:
- The compromise window. The earliest suspicious sign-in and the time you contained the account. Anything created inside this window is suspect until explained.
- The right roles. Microsoft documents that listing another user's authentication methods with delegated access needs a role such as Global Reader, Authentication Administrator or Privileged Authentication Administrator, and that an Authentication Administrator only sees masked phone numbers. Microsoft also notes that
Get-InboxRuledoes not work for members of the View-Only Organization Management role group in Exchange Online or the Global Reader role in Entra ID, so a read-only analyst may need help from an Exchange administrator. - The user. You will need them to confirm which methods, apps, rules and devices are theirs. Do this over a channel the attacker does not control, such as a phone call to a known number.
- A record. Capture every item you find and remove, with timestamps. This evidence supports the post-incident review and any notification decision.
Step 1: Close the session first
Remove the attacker's live access before you start cleaning, otherwise they can add a new rule or method while you delete the old one.
Microsoft Graph's revokeSignInSessions action invalidates all refresh tokens issued to applications for the user, and session cookies in the user's browser, by resetting the user's signInSessionsValidFromDateTime property to the current time. The user then has to sign in again to every application.
POST https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/revokeSignInSessions
Points from Microsoft's documentation to plan around:
- There can be a delay of a few minutes before tokens are revoked.
- The action does not revoke sessions for external users, because they sign in through their home tenant.
- The least privileged permission is
User.RevokeSessions.All, available as delegated or application permission.
Reset the password at the same time. The order that works best is: revoke, reset, then sweep. Move straight on to Step 2, because an attacker-registered method or email address may let them start a password reset of their own. The guide How to Revoke All Sessions for a Compromised User covers revocation in more depth.
Step 2: Authentication methods
An attacker-registered MFA method is the most dangerous foothold, because it lets them pass MFA after any password reset. Microsoft's Entra ID Protection includes a Suspicious credential addition detection (suspiciousCredentialAddition) for this pattern, but do not rely on it having fired.
List the user's methods with Microsoft Graph:
GET https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/authentication/methods
The response is a collection of method objects. Microsoft documents these method types in Graph v1.0:
emailAuthenticationMethod(used for self-service password reset)externalAuthenticationMethodfido2AuthenticationMethodmicrosoftAuthenticatorAuthenticationMethodpasswordAuthenticationMethodphoneAuthenticationMethodplatformCredentialAuthenticationMethodqrCodePinAuthenticationMethodsoftwareOathAuthenticationMethodtemporaryAccessPassAuthenticationMethodwindowsHelloForBusinessAuthenticationMethod
What to look for:
- Any method with a creation time inside the compromise window. Method objects such as FIDO2 and Windows Hello for Business carry a created timestamp in Microsoft's example response.
- An Authenticator registration on a device the user does not recognise.
- A phone number or email address the user does not recognise. An attacker-controlled email method can be used for password reset.
- A software OATH token the user never set up.
- A temporary access pass the help desk did not issue.
Note Microsoft's caveat that lastUsedDateTime is best-effort: a null or absent value does not mean the method was never used.
Removal: delete each unrecognised method using the individual delete operation for that method type. If you cannot be sure which methods are genuine, Microsoft's documented approach is to delete each of the user's current methods; once the user has none left, they are prompted to register at their next sign-in where strong authentication is required. Pair this with a temporary access pass issued through a verified channel so the user can re-enrol safely.
Step 3: OAuth app grants
A consented app keeps API access to whatever scopes it was granted, independent of the user's password. This is how many attackers keep reading mail long after a reset.
List the user's delegated grants:
GET https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/oauth2PermissionGrants
Each grant in Microsoft's example response includes clientId, consentType, principalId, resourceId and scope. The scope value is a space-separated list of delegated permissions. Microsoft lists Directory.Read.All as the least privileged delegated permission for this call; application permissions are not supported.
What to look for:
- Any grant the user does not recognise, especially to an app with an unfamiliar or generic name.
- Scopes that read or send mail, read files, or include offline access, granted inside the compromise window.
- Apps that only this user, or a small group of recently phished users, have consented to.
Two limits from Microsoft's documentation matter here:
- Tenant-wide grants are excluded. The endpoint returns only grants specific to the user. Grants made on behalf of all users in the organisation are not included. If the compromised account held an administrator role, review tenant-wide consents separately.
- Replication delay. Recently created, updated or deleted grants may take time to show. Recheck after removal.
Removal: remove the grant, and if the app is malicious, disable or remove its service principal for the tenant so other users cannot consent to it. The Consent Phishing and Illicit OAuth Grants Guide and How to detect OAuth consent phishing in Entra ID cover investigation and tenant consent settings.
Step 4: Inbox rules and forwarding
Inbox rules are a favourite of business email compromise operators. A forwarding rule exfiltrates mail; a rule that moves messages from the bank or the security team to an obscure folder, or deletes them, hides the attacker's activity from the real user.
Microsoft's Get-InboxRule cmdlet views Inbox rule properties. In Exchange Online PowerShell:
Get-InboxRule -Mailbox [email protected] -IncludeHidden
The -IncludeHidden switch includes hidden Inbox rules in the results. Always use it during a persistence sweep. Microsoft also warns that passing $null or a value that does not exist to -Identity returns all rules, so be careful when scripting removals by rule identity.
What to look for in each rule:
- Forwarding or redirecting to an external address.
- Moving messages to a folder the user rarely opens.
- Deleting messages, or marking them as read, based on keywords such as invoice, payment, password, security or the names of finance contacts.
- Rules with short, meaningless names such as a single character or punctuation.
- Rules created inside the compromise window.
Entra ID Protection includes Suspicious inbox forwarding (suspiciousInboxForwarding) and Suspicious inbox manipulation rules (mcasSuspiciousInboxManipulationRules) detections, which Microsoft lists as needing Entra ID P2 plus Defender for Cloud Apps, or Microsoft 365 E5 with EMS E5. If your tenant produces them, check for any against the user, but run the manual check either way.
Mailbox-level forwarding is configured separately from inbox rules. Check it too. The steps are covered in How to Audit Mailbox Forwarding and Inbox Rules, which this sweep does not repeat.
Removal: remove each malicious rule, then check the folders the rules moved mail into. Messages the user never saw may include replies from people the attacker contacted, which tells you who else may need to be warned.
Step 5: Devices and other footholds
An attacker with a session can sometimes register a device to the account. A registered device may satisfy Conditional Access conditions that rely on device state, depending on how your policies are written. Review the user's registered and joined devices in the Entra admin centre, and remove any the user does not recognise or that were registered inside the compromise window. The Rogue Device Registration guide covers detection and prevention.
Finish with a short list of other places worth a glance, depending on what the account could reach:
- Mailbox delegation and send-as rights granted to other accounts during the window.
- Sent items and outbound mail during the window, to find fraudulent messages that need follow-up with recipients.
- Shared file links created during the window that grant external access.
- Directory changes if the account held any administrator role: new users, role assignments, app registrations, app credentials and Conditional Access changes. A compromised administrator turns a user incident into a tenant incident.
Verifying the account is clean
After removal, check that the account is in the state you expect.
- Re-run the authentication methods and OAuth grants calls and confirm only items the user recognises remain.
- Re-run
Get-InboxRule -IncludeHiddenand confirm no unexpected rules remain. - Check the user's sign-in logs after the revocation time. Every successful sign-in should come from the user's own device and network. Any sign-in from the attacker's infrastructure after revocation means something was missed.
- Confirm the user has re-registered at least one strong method through a verified process.
- Set a reminder to repeat the sweep a few days later. Replication delays and missed footholds tend to show up on the second pass.
Common failure patterns
- Reset and close. The password is reset, the ticket is closed, and the attacker's MFA method or app consent keeps working.
- Cleaning before revoking. The attacker still holds a session and re-adds the rule you just removed.
- No hidden rules.
Get-InboxRuleis run without-IncludeHidden, and the rule that matters is not shown. - Per-user grants only. A compromised administrator granted tenant-wide consent, which the per-user grant list never shows.
- Trusting detections to be complete. No Suspicious inbox manipulation rules alert fired, so the inbox is not checked. Detections depend on licensing and are not exhaustive.
- Re-enrolling over a compromised channel. The user is sent a new temporary access pass by email to the mailbox the attacker was reading.
- One account only. The same campaign reached other users, who are never swept.
- No record. Footholds are removed without notes, so the review cannot say how long the attacker had access or what they could see.
Practitioner checklist
- Define the compromise window from the first suspicious sign-in to containment.
- Revoke sign-in sessions with
revokeSignInSessionsand reset the password before cleaning. - List authentication methods and remove every method the user cannot confirm; reset all methods if in doubt.
- List the user's
oauth2PermissionGrants, remove unrecognised grants and block malicious apps tenant-wide. - If the account held an admin role, review tenant-wide consents, role assignments and app credentials.
- Run
Get-InboxRule -IncludeHiddenand remove forwarding, hiding and deleting rules; check mailbox-level forwarding. - Review and remove unrecognised registered devices.
- Check sent items, delegations and shared links created during the window.
- Verify sign-ins after revocation come only from the user's own device and network.
- Re-enrol the user through a verified channel and repeat the sweep a few days later.
- Record every finding and removal for the post-incident review.
Standards and references
- Microsoft Learn: user: revokeSignInSessions
- Microsoft Learn: List methods (authentication)
- Microsoft Learn: Microsoft Entra authentication methods API overview
- Microsoft Learn: List a user's oauth2PermissionGrants
- Microsoft Learn: Get-InboxRule
- Microsoft Learn: What are risk detections? (Microsoft Entra ID Protection)
- MITRE ATT&CK: T1098 Account Manipulation
- MITRE ATT&CK: T1528 Steal Application Access Token
Related NHI Mgmt Group resources: Account Takeover Response Playbook · How to Audit Mailbox Forwarding and Inbox Rules · Consent Phishing and Illicit OAuth Grants Guide · AiTM Phishing Guide