Logo
How to Remove Old OneDrive Accounts in Windows (Free Up Space)
Office 365

How to Remove Old OneDrive Accounts in Windows (Free Up Space)

2 July 2020 By Hal Sclater

If you have previously logged into Office 365 accounts for different business or school tenants, they may remain even when you sign out. This is how to remove old OneDrive accounts from File Explorer in Windows.

If you are clearing a leaver’s device rather than your own, check dealing with OneDrive data for leavers first — you may still need to recover their files before deleting anything.

Why an old OneDrive account stays behind

Signing out of OneDrive does not remove the account from Windows. The account details live in two places: a per-account key under the OneDrive registry path, and a namespace entry that pins the account into the File Explorer sidebar. Both survive a sign-out, which is why a former employer’s or a leaver’s OneDrive keeps appearing under This PC long after the account was closed.

Remove an old OneDrive account in Windows 11

The steps are the same on Windows 10 and Windows 11:

  1. Disconnect the account in Settings first. Go to Settings > Accounts > Access work or school, select the old account and click Disconnect. Skipping this step is the usual reason the account comes straight back.
  2. Exit OneDrive by right clicking on the OneDrive system tray icon > Close OneDrive.
  3. Open the Registry Editor by pressing Windows + R and entering regedit.
  4. Navigate to HKEY_CURRENT_USER > Software > Microsoft > OneDrive > Accounts > BusinessName.
  5. Find the account by looking at the UserEmail value. Delete the entire folder containing that key.
  6. Navigate to HKEY_CLASSES_ROOT > CLSID. Search (CTRL+F) for keyword: OneDrive.
  7. Find the one that has the company name as the Default value.
  8. Modify the System.IsPinnedToNameSpaceTree value to 0.

If the icon is still visible, restart your computer.

Frequently asked questions

How do I remove an old OneDrive account?

Disconnect it under Settings > Accounts > Access work or school, then delete its key under HKEY_CURRENT_USER > Software > Microsoft > OneDrive > Accounts and unpin the matching CLSID entry. Deleting the registry key on its own usually clears the sidebar entry, but disconnecting the Windows account as well stops it being re-created.

Why does my old OneDrive account keep coming back?

Usually because one of two things is still in place. Either the work or school account remains connected in Windows, so OneDrive signs in again on next launch and re-creates its account key, or a cached credential is still held in Credential Manager under Windows Credentials. Disconnect the account, remove the cached credential, then repeat the registry steps with OneDrive closed.

Does this delete the files in the cloud?

No. These steps only remove the account from the local machine. Anything still in the tenant is untouched, and anything that had synced locally stays on disk unless you delete it separately.