When an employee resigns or leaves an organization, IT administrators often worry about what happens to their files. Will deleting the user’s Microsoft 365 account cause those files to disappear? The short answer is no, but the nuances of how Microsoft 365 handles a departing user’s data are critical to understand. If you don’t plan ahead, you could accidentally break automated company workflows or lose access to vital personal drafts. Here is exactly what happens behind the scenes to SharePoint and OneDrive, along with the extra operational blind spots you need to look out for.
1. Shared SharePoint Document Libraries
Files stored in central SharePoint Document Libraries or standard Microsoft Teams channels belong to the organization, not the individual user.
File Integrity: Every single document, spreadsheet, and folder remains perfectly intact and accessible to the rest of the team. For historical and auditing integrity, Microsoft 365 permanently stamps the departed user’s name on the files they interacted with. The “Created By,” “Modified By,” and Version History logs will permanently display their name.
The Restricted Profile Card: If a remaining coworker hovers over the departed employee’s name in SharePoint, a pop-up card will still appear. However, because their account is disabled or deleted in Microsoft Entra ID, the card will be stripped of contact details, manager hierarchy, and recent file activity. It acts purely as a static historical record.
2. OneDrive for Business
This is the most critical area where data loss actually occurs. Unlike SharePoint, a user’s OneDrive is their personal corporate storage closet. When their M365 license is removed or their account is deleted:
The 30-Day Default Fuse: By default, Microsoft initiates a 30-day retention countdown on that user’s OneDrive.
Manager Clean-up: During this window, the user’s direct manager is automatically sent an email notification with a link giving them access to the departed employee’s OneDrive to rescue important files.
Permanent Purge: If nobody copies or moves those files to a shared SharePoint site within that retention window (which admins can extend up to 365 days), the entire OneDrive is permanently deleted.
3. Power Automate & Power Apps
This is a massive blind spot that standard blogs often overlook. If the departing employee was tech-savvy and built automated workflows using Power Automate or custom Power Apps to run team processes.
The Flow Paradox: Even if a flow is saved or interacts with a shared SharePoint list, if it was created under the departing user’s personal account, it utilizes their API connections and credentials.
Sudden Failure: The moment their M365 account is disabled or unlicensed, the workflow will break instantly. Approvals will freeze, automated emails will stop sending, and SharePoint data entry flows will fail.
The Fix: Before they log out for the last time, an admin must export these flows or change the owner to a “Service Account” or a remaining team member.
4. Microsoft Teams, Planner, and OneNote
Because Microsoft Teams is entirely powered by SharePoint on the backend, the assets behave slightly differently depending on where the interaction happened:
Channel Files & Tab OneNotes: Because these live on the Team’s connected SharePoint site, they are completely safe.
Group Chats & Direct Messages: If the departing employee shared a file inside a private 1-on-1 text chat, that file was uploaded to their personal OneDrive “Microsoft Teams Chat Files” folder. When their OneDrive deletes after 30 days, those chat files disappear for everyone else in that chat.
Planner Buckets: Tasks assigned to the employee will display their name as an unlinked user. However, if they were the only Owner of a private team or Planner board, that resource becomes “orphaned,” requiring an IT admin to manually force-assign a new owner.
5. Security, Compliance, and Microsoft Purview
What if an employee deletes files right before they hand in their resignation? Microsoft 365 has background guardrails that overrule typical deletion cycles.
First and Second-Stage Recycle Bins: If an employee purges a file from a SharePoint library before leaving, it goes to the site Recycle Bin for 93 days. Even if they clear it from there, it sits in a hidden Second-Stage Recycle Bin where site administrators can restore it.
Litigation Holds & Retention Policies: If your organization uses Microsoft Purview and has a retention policy or an active legal hold on the departing employee, their data is unerasable. Even if the user deletes files and the 30-day OneDrive clock expires, the data is preserved in a secure, hidden Preservation Hold Library accessible only to compliance admins.
Understanding what happens to SharePoint and OneDrive data is important, but administrators also need to take action to ensure business files remain accessible after an employee leaves.
PowerShell can help with these tasks, from reviewing SharePoint site ownership and assigning replacement administrators to managing OneDrive retention and delegating access to important files.
Manage SharePoint and OneDrive Data During Employee Offboarding Using PowerShell
The following examples use the SharePoint Online Management Shell and Microsoft Graph PowerShell SDK. Before running SharePoint management commands, install the SharePoint Online PowerShell module.
Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser
# Import the module
Import-Module Microsoft.Online.SharePoint.PowerShell
# Connect to your organization's SharePoint Online admin center
Connect-SPOService -Url "https://contoso-admin.sharepoint.com" -UseSystemBrowser $true Replace contoso with your tenant name and authenticate using an account with the SharePoint Administrator or Global Administrator role. The -UseSystemBrowser parameter enables browser-based authentication and can help avoid Windows Web Account Manager (WAM) authentication issues.
Review SharePoint Site Ownership
Before deleting an employee’s account, identify the SharePoint sites they manage and check whether another administrator has access. Retrieve all SharePoint sites and their registered owners.
Get-SPOSite -Limit All |
Select-Object Title, Url, Owner To review the site collection administrators of a specific site.
Get-SPOUser -Site "https://contoso.sharepoint.com/sites/Marketing" |
Where-Object { $_.IsSiteAdmin -eq $true } |
Select-Object DisplayName, LoginName This helps identify sites that may require additional administrative coverage after the employee leaves.
Note: The Owner property and site collection administrator list do not provide a complete inventory of Microsoft 365 group owners or all SharePoint permission assignments.
Assign a Replacement SharePoint Site Administrator
If the departing employee has administrative responsibility for a SharePoint site, assign another administrator before removing their account.
Set-SPOUser -Site "https://contoso.sharepoint.com/sites/Marketing" `
-LoginName "manager@contoso.com" `
-IsSiteCollectionAdmin $true This grants the replacement user site collection administrator privileges. For standalone SharePoint sites, administrators can also update the primary site collection owner.
Set-SPOSite -Identity "https://contoso.sharepoint.com/sites/Marketing" `
-Owner "manager@contoso.com" For Microsoft 365 group-connected sites, group ownership must be managed separately.
Check and Extend OneDrive Retention
When an employee’s Microsoft 365 account is deleted, their OneDrive is retained for 30 days by default. Administrators can review the configured retention period like below.
Get-SPOTenant |
Select-Object OrphanedPersonalSitesRetentionPeriod If additional time is required to recover or transfer business files, extend the retention period to 365 days.
Set-SPOTenant -OrphanedPersonalSitesRetentionPeriod 365 Note: This is a tenant-wide setting, not an individual user configuration. Supported values range from 30 to 3,650 days.
Delegate Access to a Departing Employee’s OneDrive
Administrators can grant a manager or another authorized employee access to the departing user’s OneDrive to retrieve important business documents. First, identify the user’s OneDrive URL.
Get-SPOSite -IncludePersonalSite $true -Limit All |
Where-Object { $_.Url -like "*john*" } |
Select-Object Url, Owner Then grant the replacement user site collection administrator access.
Set-SPOUser -Site "https://contoso-my.sharepoint.com/personal/john_contoso_com" `
-LoginName "manager@contoso.com" `
-IsSiteCollectionAdmin $true The replacement user can then review and transfer important documents to an appropriate shared SharePoint library. This command grants administrative access rather than transferring ownership of the OneDrive itself. Temporary elevated permissions should be removed when they are no longer needed.
Before deleting an employee’s account, confirm where their files are stored, transfer ownership of key resources, and review retention settings so the team can keep working without losing access to essential data.