Hackers Deleted Your SharePoint Files: How Microsoft 365 Retention Policies Can Help

Imagine a healthcare organization that stores patient documentation, billing records, and administrative files in SharePoint. An attacker compromises an employee's account, deletes business-critical documents, and empties both SharePoint Recycle Bins.
Employees lose access to important information, business operations are disrupted, and IT administrators face the challenge of recovering permanently deleted files.
By configuring Microsoft 365 retention policies in advance, organizations can preserve critical information even when the original documents are maliciously deleted.
How Do Microsoft 365 Retention Policies Work?
Microsoft Purview automatically preserves copies of protected content when users modify or delete it during the applicable retention period.
Depending on the Microsoft 365 service, retained content is stored in dedicated system locations:
Microsoft 365 service | Retained content location |
SharePoint Online | Preservation Hold Library |
OneDrive for Business | Preservation Hold Library |
Exchange Online | Recoverable Items folder |
For SharePoint and OneDrive, preserved documents remain available during the applicable retention period, even if users empty both Recycle Bins.
Administrators can retrieve these documents using Microsoft Purview eDiscovery.
Supporting Regulatory Compliance: HIPAA Example
In addition to protecting against data loss, retention policies help organizations meet regulatory and legal requirements.
For example, under the HIPAA Security Rule (45 CFR § 164.316(b)(2)(i)) and Privacy Rule (45 CFR § 164.530(j)(2)), required compliance documentation must be retained for at least six years from its creation date or the date it was last effective, whichever is later.
This includes security policies, risk assessments, required incident documentation, and privacy procedures.
Healthcare organizations can configure six-year retention for Exchange Online mailboxes, SharePoint sites, OneDrive accounts, and Microsoft 365 Groups containing relevant documentation.
However, HIPAA does not mandate six-year retention for all Microsoft 365 content or patient medical records. Organizations should define their retention requirements based on applicable regulations and business needs.
How to Configure a Retention Policy in Microsoft Purview
Prerequisites
Microsoft 365 Business Premium, E3, E5, or another eligible subscription.
Administrator permissions that include the Retention Management role.
Defined data retention requirements.
Step 1. Create a retention policy
Sign in to the Microsoft Purview portal
Navigate to Solutions → Data Lifecycle Management → Policies → Retention policies.
Select New retention policy.
Enter a name and description for the policy.
Under Assign admin units, select Full directory, if appropriate.
Select Static as the policy type.
Step 2. Select the locations
Enable the Microsoft 365 locations containing information that must be retained.
Location | Protected content |
Exchange mailboxes | Email messages and supported mailbox content |
SharePoint classic and communication sites | Documents stored in applicable SharePoint sites |
OneDrive accounts | Files stored in users' OneDrive accounts |
Microsoft 365 Group mailboxes & sites | Group mailboxes and group-connected SharePoint sites |
You can apply the policy to all supported locations or include specific mailboxes, sites, accounts, and groups.
For this example, select the locations containing the healthcare organization's compliance documentation.
Step 3. Configure retention settings
Configure the following settings for a six-year, retain-only policy covering SharePoint compliance documents:
Setting | Configuration |
Retention action | Retain items for a specific period |
Retention period | 6 years |
Start the retention period based on | When items were last modified |
At the end of the retention period | Do nothing |
Selecting Do nothing ensures that this policy does not automatically delete original documents when the retention period expires.
Step 4. Publish and verify the policy
Review the configuration and submit the policy.
Allow up to seven days for the policy to take effect. Verify its deployment status before relying on it to preserve business-critical information.
How to Retrieve Permanently Deleted SharePoint Files
If protected SharePoint documents are permanently deleted, administrators can use Microsoft Purview eDiscovery to retrieve retained copies.
Sign in to the Microsoft Purview portal.
Navigate to Solutions → eDiscovery → Cases.
Create a new case and search.
Add the affected SharePoint site as a data source.
Configure search conditions to identify the deleted documents.
Run the search and review the results.
Export and download the required documents.
Validate the retrieved files and upload them back to the appropriate SharePoint document library.
Ensure that the administrator has the appropriate eDiscovery permissions and licensing.
If the deletion resulted from an account compromise, contain the security incident and secure the affected account before restoring documents.
Conclusion
Data protection should be a proactive measure rather than a response to a security incident. Microsoft Purview provides an additional layer of protection against malicious deletion and accidental data loss while supporting regulatory compliance requirements.
Contact PlexHosted to strengthen your Microsoft 365 security and compliance posture.





Comments