How to Recover Files After a User Leaves the Company in OneDrive for Business
🔍 WiseChecker

How to Recover Files After a User Leaves the Company in OneDrive for Business

When an employee leaves your company, their OneDrive for Business files can become inaccessible if the account is deleted or disabled. Without the right steps, you risk losing business-critical documents stored only in that user’s personal library. This article explains how to locate, transfer, and recover files from a former employee’s OneDrive before or after their account is removed. You will learn the exact admin procedures in the Microsoft 365 admin center to preserve data and avoid permanent loss.

Key Takeaways: OneDrive File Recovery for Departed Employees

  • Microsoft 365 admin center > Users > Active users: Access the leaving user’s account to initiate a OneDrive transfer or set a retention period before deletion.
  • SharePoint admin center > User profiles > Manage user profiles: Find and navigate to a former user’s OneDrive site URL even after the account is deleted.
  • OneDrive admin center > Storage > User storage: View storage details and assign a new owner to the departed user’s OneDrive files.

ADVERTISEMENT

Why OneDrive Files Become Unreachable After a User Leaves

OneDrive for Business is tied directly to each user’s Microsoft 365 license. When an administrator disables or deletes a user account, that person’s OneDrive site and all files inside it become inaccessible. By default, Microsoft retains the OneDrive for 30 days after the user is deleted from Azure Active Directory. During this retention window, you can still recover files. After 30 days, the site and its contents are permanently removed unless you have configured a longer retention policy.

The core challenge is that OneDrive for Business is not a shared document library. It is a personal storage space. Without explicit admin action, no other user can view or download the files. The recovery process depends on whether you act before or after the user account is deleted. If you plan ahead, you can transfer ownership of the files to another user. If the account is already gone, you must use SharePoint admin tools to restore the OneDrive site.

Retention and Deletion Timelines

Microsoft 365 provides a retention period for deleted OneDrive sites. The default is 30 days. You can change this setting in the OneDrive admin center under Storage settings. After the retention period ends, the site enters a recycle bin stage for another 93 days, but only global admins or SharePoint admins can restore it. After that, the site is permanently deleted. Understanding these timelines is critical for planning file recovery.

Steps to Transfer or Recover OneDrive Files After a User Leaves

The method you use depends on whether the user account is still active or has been deleted. Follow the section that matches your current situation.

Method 1: Transfer Files Before Deleting the User Account

This is the recommended approach. It gives another user full access to the files without risking data loss.

  1. Sign in to the Microsoft 365 admin center
    Go to https://admin.microsoft.com and sign in with a Global admin or SharePoint admin account.
  2. Navigate to the user management page
    Select Users then Active users. Find the departing employee in the list and click their name.
  3. Open the OneDrive tab
    In the user details panel, select the OneDrive tab. This shows the user’s storage quota and usage.
  4. Start the file transfer
    Click Transfer files. A panel opens asking for a destination user. Enter the name or email of the user who will receive the files.
  5. Choose what to transfer
    Select Transfer all files or choose specific folders. You can also give the destination user read-only or full control access.
  6. Complete the transfer
    Click Start transfer. Microsoft moves the files to a new folder named “Transferred from [user name]” in the destination user’s OneDrive. The process can take from a few minutes to several hours depending on file volume.
  7. Notify the destination user
    Send an email to the recipient informing them that files have been transferred. They can access the folder from their OneDrive web interface.

Method 2: Recover Files After the User Account Is Deleted

If you already deleted the user account, you can still recover files within the retention period. You need the user’s OneDrive site URL.

  1. Find the deleted user’s OneDrive URL
    In the Microsoft 365 admin center, go to Users then Deleted users. Find the user and note their user principal name (UPN) — for example, jdoe@contoso.com.
  2. Construct the OneDrive URL
    Replace yourdomain with your company’s tenant domain and jdoe with the user’s UPN prefix: https://yourdomain-my.sharepoint.com/personal/jdoe_yourdomain_com. If you are unsure, ask your SharePoint admin for the exact URL.
  3. Access the OneDrive site as admin
    Open the URL in a browser. You must be a Global admin or SharePoint admin to see the site. If prompted, sign in with your admin account.
  4. Restore the site from the recycle bin if needed
    If the site is deleted, go to the SharePoint admin center at https://admin.microsoft.com/SharePoint. Select Deleted sites. Find the OneDrive site by its URL and click Restore.
  5. Download or copy the files
    Once the site is accessible, navigate to the Documents library. Select the files or folders you need and click Download or Copy to to move them to another location.
  6. Assign a new owner to the site
    To prevent future access issues, go to the site permissions and add another user as site owner. This gives them ongoing access to the files.

Method 3: Use PowerShell to Recover Files in Bulk

For large recoveries involving multiple users, PowerShell scripts can automate the process. This method requires the SharePoint Online Management Shell.

  1. Install the SharePoint Online Management Shell
    Open PowerShell as an administrator and run Install-Module -Name Microsoft.Online.SharePoint.PowerShell.
  2. Connect to SharePoint Online
    Run Connect-SPOService -Url https://yourdomain-admin.sharepoint.com and sign in with your admin credentials.
  3. Restore a deleted OneDrive site
    Use the command Restore-SPODeletedSite -Identity https://yourdomain-my.sharepoint.com/personal/jdoe_yourdomain_com. This restores the site from the recycle bin.
  4. Export a list of deleted sites
    Run Get-SPODeletedSite -IncludePersonalSite $true | Select-Object Url, Status, DaysRemaining to see all deleted OneDrive sites and their retention status.
  5. Download files using the PnP PowerShell module
    Install the PnP PowerShell module with Install-Module -Name PnP.PowerShell. Then connect to the restored site and download files with Get-PnPFolderItem -FolderSiteRelativePath "Documents" | ForEach-Object { $_.Name }.

ADVERTISEMENT

Common Issues When Recovering OneDrive Files After a User Leaves

“You don’t have access to this site” When Opening the OneDrive URL

This error means you are not a SharePoint admin or the site has been permanently deleted. Verify your admin role in the Microsoft 365 admin center under Roles. If you are a global admin but still see this error, the site may be beyond the retention period. Check the deleted sites list in the SharePoint admin center. If the site does not appear there, it is permanently gone.

Transfer Files Button Is Grayed Out

The transfer feature requires the source user to have an active OneDrive license. If the user’s license was removed before you attempted the transfer, the button is disabled. Restore the user from deleted users first, assign a OneDrive license, then perform the transfer. After the transfer completes, you can delete the user again.

Transferred Files Appear Empty or Missing

File transfer copies only the files that the user owned. Shared files with edit permissions but owned by others remain in the original owner’s OneDrive. If the destination user sees an empty folder, check whether the source user had files stored in their OneDrive root or in subfolders. Also verify that the transfer process completed by checking the notification in the admin center.

Recovering Files After the 30-Day Retention Period

If more than 30 days have passed since the user was deleted, the OneDrive site enters a second-stage recycle bin that only admins can access. Go to the SharePoint admin center, select Deleted sites, and click Second-stage recycle bin. If the site is not there, it has been permanently deleted. To prevent this in the future, set a longer retention period in the OneDrive admin center under Storage > OneDrive retention.

Item Transfer Before Deletion Recover After Deletion
Required admin role Global admin or SharePoint admin Global admin or SharePoint admin
User license needed Yes, user must have active OneDrive license No, but user must have been deleted within retention period
Time window Any time before user deletion Within 30 days of deletion (default retention)
File access for recipient Full control or read-only as configured Admin must assign permissions manually
Risk of data loss Low, if transfer completes Moderate, if retention period expires

Now you have the exact steps to recover files from a former employee’s OneDrive for Business. Start by checking whether the user account still exists. If it does, use the transfer feature in the admin center. If the account is already deleted, restore the OneDrive site from the SharePoint recycle bin within 30 days. For ongoing protection, configure a OneDrive retention policy of at least 90 days in the OneDrive admin center. This gives you a safety buffer for future employee departures.

ADVERTISEMENT