Logo
Dealing with OneDrive Data for Leavers
Office 365

Dealing with OneDrive Data for Leavers

17 November 2021 By Hal Sclater

When users leave your organisation, you may want to keep their documents for a limited time, or permanently. If your users are fully online (i.e. you don’t have an on-premise Active Directory), then the process is easy and you are offered to give the data to another user for 30 days at the time of account deletion.

However, if you have on-premise Active Directory synced using AD Connect (Hybrid AD), OneDrive will be deleted with no warning, and only retained for 30 days by default. This post describes how to retain OneDrive data in that scenario.

Increase OneDrive Retention for Deleted Users

Image 3

Log on to the SharePoint admin center, go to Settings > OneDrive > Retention and increase the retention setting from the default 30 days up to a maximum of 3650 days. We recommend 1 year.

Options for Keeping OneDrive Data

  1. Delete the user — Use the built-in feature to grant someone access to the leaver’s data for 30 days (cloud-only users only).
  2. Grant access via a link (temporary) — Use 365 admin or PowerShell to grant permissions for up to 1 year.
  3. Copy OneDrive content (permanent) — Copy the data to another user’s OneDrive using a tool or manual process.

Option 1: Delete the User (Cloud Only)

When you delete a user from the Microsoft 365 admin center, you can choose what to do with their product licenses, email, and OneDrive. If you give another user access, they’ll have 30 days to access and download the files.

For on-prem synced accounts, this doesn’t work cleanly. The account deletion will fail but OneDrive permissions can still be granted.

Using 365 Admin

Image 12

Image 14

Image 13

  1. Go to admin.microsoft.com.
  2. Open the leaver’s user properties, click OneDrive, and click Create link to files.
  3. Click the link to open the user’s OneDrive.
  4. Go to Settings > OneDrive Settings > More Settings > Site collection administrators.
  5. Add the other user.

Using PowerShell

$userURL = "https://tenant-my.sharepoint.com/personal/user_domain_com/"
$admin = "admin@domain.com"
Connect-SPOService -Url "https://tenant-admin.sharepoint.com"
Set-SPOUser -Site $userURL -LoginName $admin -IsSiteCollectionAdmin $true

Option 3: Copying OneDrive Content (Permanent)

Check the Size First

Connect-SPOService -Url "https://tenant-admin.sharepoint.com"
Get-SPOSite -IncludePersonalSite $True -Limit All -Filter "Url -like '-my.sharepoint.com/personal/first_last_domain_com'" | Select Owner, Title, URL, StorageQuota, StorageUsageCurrent

Copy Using a Commercial Tool

A tool like Sharegate can copy data without user action. First grant your admin account access to both source and destination OneDrive, then use the tool to copy.

Copy Using OneDrive

Grant the new user permissions on the leaver’s OneDrive, then instruct them to open the OneDrive link and use Move to to copy the data.

Image 4

Image 8

Image 9

Image 7

Image 11

Image 15