When an employee leaves the organization, disabling the account is only one part of the offboarding process. What happens to their OneDrive? In many Microsoft 365 environments, OneDrive sites continue to exist long after a user account has been deleted or disabled. If nobody is assigned to manage the data, these sites become orphaned OneDrive accounts, holding critical documents without an active owner.
These forgotten storage locations can lead to compliance risks and unnecessary storage costs. If they aren’t discovered before Microsoft’s retention period expires, they may also result in permanent data loss. In this guide, you’ll learn how to identify orphaned OneDrive accounts in Microsoft 365.
What Is an Orphaned OneDrive Account?
An orphaned OneDrive usually happens during messy employee offboarding, company mergers, or corporate restructures. When an account is left unmanaged, your company faces three major threats:
- Microsoft 365 deletes unowned OneDrive accounts after a set retention period (usually 30 days by default). If an employee leaves critical business files in their personal drive, that data could vanish forever.
- If a deleted user’s OneDrive contains sensitive customer or financial records, it must be managed under your company’s data retention laws. Leaving it unmonitored breaks compliance.
- If an orphaned drive still allows external sharing, outsiders might continue to access company data long after the internal employee is gone.
Why Microsoft 365 Doesn’t Make Finding Orphaned OneDrive Sites Easy
Many administrators assume the Microsoft 365 admin center or OneDrive admin center includes a report for orphaned OneDrive accounts. Unfortunately, it doesn’t!
The OneDrive admin center lets you manage storage, sharing, and user settings, but it isn’t designed to answer lifecycle questions like:
- Which OneDrive sites belong to deleted users?
- Which owners are disabled?
- Which sites no longer have a valid Microsoft Entra account?
- Which OneDrive sites haven’t been accessed in months?
How to Find OneDrive Sites Without an Owner
To connect the dots between Microsoft Entra ID (user status) and SharePoint Online (OneDrive ownership), you must use PowerShell. Before running these scripts, ensure you have installed and connected to both the SharePoint Online PowerShell module and the Microsoft Graph PowerShell module.
1. Find OneDrive Sites with Missing Owners
You can use Get-SPOSite to find OneDrive sites where the primary owner is missing, deleted, or unassigned.
# Get all OneDrive sites and filter for missing or blank owners
Get-SPOSite -IncludePersonalSite $true -Limit All | Where-Object { $_.Url -like "*personal*" -and ([string]::IsNullOrEmpty($_.Owner) -or $_.Owner -eq "None") } | Select-Object Url, Owner, StorageUsageCurrent 2. Cross-Check with Disabled Users in Entra ID
This script checks all OneDrive owners against Microsoft Graph to see if their Entra ID account is currently disabled (AccountEnabled -eq $false).
# Connect to Microsoft Graph
Connect-MgGraph -Scopes "User.Read.All", "SharePointTenantService.Read.All"
# 1. Get all OneDrive sites
$AllOneDrives = Get-SPOSite -IncludePersonalSite $true -Limit All | Where-Object { $_.Url -like "*personal*" }
# 2. Loop through and check Entra ID status
foreach ($Drive in $AllOneDrives) {
if (![string]::IsNullOrEmpty($Drive.Owner)) {
# Fetch user status from Entra ID
$User = Get-MgUser -UserId $Drive.Owner -ErrorAction SilentlyContinue
# If user exists and is disabled, output the details
if ($User -and $User.AccountEnabled -eq $false) {
[PSCustomObject]@{
OneDriveUrl = $Drive.Url
OwnerEmail = $Drive.Owner
AccountStatus = "Disabled in Entra ID"
}
}
}
} 3. Check Retention and Activity States
To find out if a OneDrive is locked by a retention policy, you can check its hold status. To see if it is active, you check the last time the user modified any content.
#Check Hold/Retention State and Lock State
Get-SPOSite -IncludePersonalSite $true -Limit All | Where-Object { $_.Url -like "personal" } | Select-Object Url, Owner, LockState, Title, Template | Format-Table -AutoSize Note: If a site is on hold due to a retention policy, the LockState might show as NoAccess or ReadOnly if it is being preserved during deletion.
The Smarter Way: Managing OneDrive Lifecycle with EasyEntra
Manually running PowerShell scripts every week to catch orphaned accounts is exhausting and prone to human error. EasyEntra eliminates this headache by treating OneDrive management as a core part of the offboarding workflow.
Instead of hunting for abandoned drives after the user is gone, EasyEntra helps you secure and transition the data automatically the moment an employee leaves.
1. Automatically Delegate OneDrive Access
When an employee leaves the organization, their manager or another team member often needs access to the employee’s files to complete ongoing work. EasyEntra makes this easy by allowing you to assign a new Site Collection Administrator to the user’s OneDrive during offboarding. This ensures that ownership is transferred immediately and prevents the OneDrive from becoming orphaned.
To assign a Site Collection Administrator:
- Open User Properties for the user.
- Go to the OneDrive tab and select OneDrive Delegation.
- Begin typing the delegate’s name and select the appropriate user.
- To remove an existing delegate, select the user and click Remove.
- Click OK twice to save the changes.
2. Secure the OneDrive by Restricting External Sharing
Even after an employee leaves, files that were previously shared externally may remain accessible unless action is taken. EasyEntra allows you to immediately update the OneDrive’s sharing configuration or lock down the site, helping prevent accidental or unauthorized access while you decide how the data should be handled.
To configure external sharing:
- Open User Properties for the user.
- Navigate to the OneDrive tab.
- Select the required option from the External sharing drop-down menu.
- Click OK to apply the configuration.
3. Archive OneDrive Content by Exporting It to ZIP
If your organization needs to retain a user’s files but wants to remove their Microsoft 365 license, EasyEntra provides a simple way to export the entire OneDrive to a ZIP archive. This allows you to preserve the data for compliance, backup, or future reference before the account is removed.
To export a user’s OneDrive:
- Open User Properties for the user.
- Select the OneDrive tab.
- Click OneDrive Storage, then choose Export to open the export window.
- Click Export to begin the process.
If your account doesn’t already have the required Site Collection Administrator permissions, EasyEntra will prompt you to assign them temporarily. These permissions are automatically removed after the export completes.
The export time depends on the size of the user’s OneDrive. Once the process finishes, click Close to exit the export window.