/
/

How to Recover Data After a Ransomware Attack on Microsoft 365

by Mauro Mendoza, IT Technical Writer
How to Recover Data After a Ransomware Attack on Microsoft 365 blog banner image
How to Recover Data After a Ransomware Attack on Microsoft 365 blog banner image

Key points

  • Immediately contain an active attack by disconnecting infected devices, revoking active cloud sessions, and disabling file sync to halt the spread of encryption.
  • Map the full blast radius using the Microsoft Purview Unified Audit Log to ensure you do not accidentally restore infected data over clean backups.
  • Choose the appropriate recovery strategy based on the attack’s scale, utilizing everything from native version history rollbacks to air-gapped third-party restorations.
  • Recognize that under the shared responsibility model, Microsoft is responsible for maintaining the Microsoft 365 service, while your organization is responsible for protecting and recovering its own data, including backup and retention strategies.
  • Establish clear Recovery Point Objective (RPO) and Recovery Time Objective (RTO) metrics to calculate the business cost of downtime and prioritize which systems to restore first.
  • Proactively harden your tenant against future breaches by enforcing phishing-resistant MFA, applying conditional access policies, and configuring immutable retention rules.

When ransomware strikes, files can be encrypted, and critical business data may become inaccessible, disrupting normal operations. Minimizing downtime requires immediate containment and effective data protection, recovery measures, and a strong Microsoft 365 ransomware protection strategy.

In this guide, you will learn how to quickly contain breaches, restore affected workloads, and prevent permanent data loss.

Immediate steps for Microsoft 365 ransomware recovery and containment

Containing an active breach immediately is the most critical step in Microsoft 365 (formerly known as Office 365) ransomware recovery to prevent widespread data loss.

  1. Identify and isolate infected devices.
    1. Disconnect affected computers from all networks immediately to stop the spread.
    2. Use tools like Microsoft Defender to isolate compromised devices.
    3. Leave them powered on to preserve evidence for later investigation.
  2. Revoke active user sessions.
    1. Sever the attacker’s cloud access instantly.
    2. Administrators should run the Revoke-MgUserSignInSession PowerShell command.
    3. This forces compromised users out of Microsoft 365 by requiring them to sign in again.
  3. Disable OneDrive and SharePoint sync.
    1. Stop malicious encryption from reaching the cloud.
    2. Go to the SharePoint Admin Center and temporarily disable the Sync feature.
      • This prevents infected local computers from uploading encrypted files and overwriting clean cloud data.
  4. Lock compromised accounts.
    1. Secure compromised accounts to prevent unauthorized access.
    2. Restrict access for affected users until the incident has been contained.
    3. Suspend their access and force mandatory password resets before allowing them back online.

See Related: Detecting and Responding to Credential Theft in Microsoft 365 Environments

Assessing the total blast radius for Microsoft ransomware recovery

Assessing the total blast radius of an attack requires precise forensic investigation to determine exactly what data was compromised.

IT professionals must analyze the Microsoft Purview Unified Audit Log to investigate the scope of the incident. By reviewing bulk FileModified and FileDeleted events, administrators can identify suspicious file activity and determine which data may have been affected.

Mapping these compromised files is essential before initiating ransomware data recovery. Accurately defining the affected areas prevents administrators from accidentally restoring infected, “dirty” data over clean backups, which would undermine your broader Microsoft 365 ransomware protection strategy.

Anatomy of the attack

Indicator of Compromise (IoC)Impacted WorkloadActions Required
Massive .encrypted file extensionsOneDrive / SharePointBulk Point-in-Time Restore
Mailbox Rules “Forwarding” to externalExchange OnlineRule Audit & Cleanup
Deletion of SharePoint SitesSharePointSecond-Stage Recycle Bin Recovery

Selecting the appropriate recovery method

Choosing the right data restoration approach depends entirely on the attack’s scale, ranging from built-in free tools to dedicated enterprise platforms.

Method A: Native Point-in-Time Restore (SME/Standard)

This built-in approach is ideal for individual users or small teams dealing with recent infections. It provides effective, localized recovery, provided you act within a 30-day window.

  • Rolling back an entire OneDrive library to a specific date before the infection started.
  • Utilizing Version History to restore encrypted files to previous clean versions.
  • Retrieving deleted items using the 93-day Safety Net provided by the SharePoint Recycle Bin.

Method B: Microsoft 365 Backup Service (Enterprise Native)

This native Microsoft 365 backup service provides fast recovery capabilities for large volumes of data. It can help organizations accelerate data restoration following ransomware incidents and other data loss events.

  • Executing large-scale restorations directly through the dedicated Backup tab in the Microsoft 365 Admin Center
  • Enabling faster recovery of large volumes of data compared to traditional restoration methods

Method C: Third-party immutable recovery

External, third-party platforms, like NinjaOne, represent the absolute gold standard for compliance. They provide total immunity against ransomware in Microsoft 365 by keeping your historical data completely isolated from your primary environment.

  • Securing data with air-gapped backups helps prevent backup data from being modified or encrypted during an attack.
  • Restoring files to an isolated recovery environment or a separate tenant to scan and validate data before returning it to production.

Specific recovery procedures for individual workloads

To efficiently execute your Microsoft 365 ransomware recovery, you must use the specific restoration tools built into each core application.

Microsoft 365 WorkloadRecovery FocusPractical Action Steps
Exchange OnlineRecoverable Items FolderUse PowerShell to bulk-restore deleted emails and purge malicious inbox rules across all employee accounts simultaneously.
SharePoint OnlineSite Collections vs. LibrariesExecute specific SharePoint Online ransomware recovery steps by rolling back document libraries via version history or restoring full sites.
OneDrive for BusinessSelf-Service RollbackDirect employees to use the Restore your OneDrive feature to recover personal files from an earlier point in time when available.

Hardening the environment against future Microsoft 365 ransomware incidents

To prevent future breaches and ensure long-term resilience, organizations must proactively harden their Microsoft 365 environment against emerging threats.

A layered defense helps reduce the risk of ransomware. While recovery tools help restore data after an incident, preventive security controls can limit opportunities for attackers to gain access and cause damage.

The essential hardening checklist

  • Enforce phishing-resistant MFA: 
    • Transition your users away from vulnerable SMS texts or push notifications.
    • Implement robust methods like FIDO2 security keys or Windows Hello to help reduce the risk of credential theft.
  • Apply conditional access policies: 
    • Restrict who can access your Microsoft 365 environment and from where.
    • Configure policies to automatically block login attempts from non-compliant devices or unexpected, high-risk geographic locations.
  • Implement immutable retention policies: 
    • A core component of reliable Microsoft 365 data backup strategies for ransomware is data immutability.
    • Apply a Preservation Lock to retention policies to help prevent protected data from being deleted, even if an administrative account is compromised.
  • Configure Purview alerting: 
    • Speed is critical during an attack. Set up Activity Alerts within Microsoft Purview to immediately notify your IT team if unusual behaviors, such as mass file deletions or bulk modifications, occur.

Defining RPO and RTO for the business

Defining your recovery metrics translates technical disaster recovery into clear business math. It balances the financial cost of downtime against your technical capabilities, ensuring your Microsoft 365 data backup strategies for ransomware align with real-world limits.

Recovery Point Objective (RPO)

This defines the maximum amount of data your organization can afford to lose. It measures backward from the incident. For example, a four-hour RPO means the business accepts losing the last four hours of work.

Recovery Time Objective (RTO)

This dictates the maximum acceptable downtime before systems must be online again. It measures forward from the disaster. For instance, a six-hour RTO means IT must complete all Microsoft 365 ransomware recovery steps within six hours.

Calculate recovery priorities

To prioritize system recovery during an incident, IT teams should evaluate the business impact and recovery requirements of each application. One possible approach is to use a prioritization score such as:

Priority Score = (Criticality x User Impact) / Restore Time

Common misconceptions regarding Microsoft 365 ransomware recovery

Believing standard cloud myths often delays effective incident response and compromises your overall ransomware data recovery strategy.

Common MisconceptionThe Technical Reality
The cloud is automatically backed up.Microsoft is responsible for operating the Microsoft 365 service, but under the shared responsibility model, organizations remain responsible for protecting and recovering their own data.
Cloud sync is the same as a backup.Synchronization is just a mirror. If ransomware encrypts a local document, that corruption syncs to the cloud instantly, overwriting your clean files.
Standard MFA makes me unhackable.Modern attackers routinely bypass basic SMS or push-based MFA by stealing session tokens, allowing them to hijack active cloud sessions without needing your password.

Supporting recovery with Microsoft 365 ransomware protection

Surviving an attack requires swift containment and a structured recovery process. Because native tools often fall short during major incidents, deploying dedicated backups is your most reliable defense.

Proactive Microsoft 365 ransomware protection can help organizations recover clean data more efficiently and reduce the risk of permanent data loss.

Related topics:

FAQs

Once the 30-day window for native Point-in-Time Restore expires, recovery options become significantly more limited. Organizations with dedicated backup solutions are typically better positioned to recover affected data beyond native recovery windows.

This highlights why independent, long-term archiving is a crucial component of enterprise ransomware protection.

A Clean Room provides a secure, isolated cloud environment where IT teams can scan restored files for dormant malware before returning them to the live network.

This helps reduce the risk of reintroducing hidden ransomware or other malware during the recovery process.

Because Teams does not have its own separate storage backend, you must recover its data by restoring the underlying SharePoint sites for channel files and Exchange Online mailboxes for chat histories.

Immutable backups use a Write-Once, Read-Many (WORM) architecture that helps prevent protected backup data from being modified or deleted during the defined retention period, even if an administrative account is compromised.

This helps ensure a reliable recovery point remains available if attackers attempt to delete backup data before launching a ransomware attack.

As a last resort, Microsoft Support may be able to assist with certain recovery scenarios, but recovery options are typically limited and depend on the affected service, available retention settings, and how much time has passed since the data was deleted.

Once native recovery and retention windows have expired, recovering deleted data may no longer be possible without an independent backup solution.

You might also like

Ready to simplify the hardest parts of IT?