EASYENTRA Blog

News & Updates

How to Find Orphaned OneDrive Accounts in Microsoft 365

How to Find Orphaned OneDrive Accounts in Microsoft 365

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:

  1. Open User Properties for the user.
  2. Go to the OneDrive tab and select OneDrive Delegation.
  3. Begin typing the delegate’s name and select the appropriate user.
  4. To remove an existing delegate, select the user and click Remove.
  5. 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:

  1. Open User Properties for the user.
  2. Navigate to the OneDrive tab.
  3. Select the required option from the External sharing drop-down menu.
  4. 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:

  1. Open User Properties for the user.
  2. Select the OneDrive tab.
  3. Click OneDrive Storage, then choose Export to open the export window.
  4. 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.

Free 30-minute demo

try 30 days for free

GET EASYENTRA NEWS

Opt out at any time

“One of the best products I've used.”
Gary Shurland
Chief Information Officer, Mirick, United States
“This tool has been invaluable in streamlining our IT processes.”
Tyson Mckay
Chief Information Officer, Southwest Network, United States
“This product has been a miracle for our Help Desk. EasyEntra has completely transformed how we handle Microsoft 365 administration.”
Doug Sanders
Manager of Technical Customer Support, Junior Achievement USA, United States
“Your product is such a time saver. I love it!”
Scott Fehr
IT Infrastructure, MEC Aerial Work Platforms, United States
“It's a good product and saves us lots of time for these ongoing quick admin tasks.” 
Chris McFerran
Managing Director, CTech IT Solutions Ltd, United Kingdom
“EasyEntra has significantly streamlined our workflow, simplifying everything. It feels almost like a revolution.”
Johan Sadelius
IT-chef, Arjeplog Kommun, Sweden
I greatly appreciate your assistance and willingness to enhance the already outstanding product.”
Michael I. Wilson
Executive Director of Information Technology, Archdiocese Of Washington, United States
“It's great not having to switch back and forth between the O365 admin center and the Teams admin center to assign groups. I am sold!”
Thomas Madden
Director Information Technology, AutoPayPlus, United States
“I would highly recommend organizations use the solution as it greatly simplifies various tasks.”
S. Roger Singh
Chief Technology Officer, Prasad & Company LLP, Canada
“EasyEntra is time-saving. Love the copy/paste for user/computer groups and the copy to new user.”
Damian Nita
Associate Network Administrator, Shenandoah Valley Westminster-Canterbury, United States
“EasyEntra has transformed our daily IT operations by simplifying user management, reducing errors, and enhancing overall efficiency.”
Henrik Nefling
IT- and Digitalization Manager, Animal Protection Denmark, Denmark