When an employee leaves the company and you delete his/her account today, the OneDrive for business site ownership is transferred to the manager and secondary My site Owner. The Manager and secondary owner can continue to access the personal site for 3650 days via URL of the OneDrive for Business site.
For this to occur, the user profile manager property and Access Delegation need to be set for the deleted users before deleting it. To do that Global admin or SharePoint admin can make the changes.
- Go to the SharePoint Admin Center.
- Click the User profile –> People –> Manage User Profiles –> Find the user account to deleted –> Edit my profile –> Manager –> type the manager account into the box –> Save and close.
3. Go to SharePoint admin center –> User profiles –> My Site Setting –> Setup My Site –> My site Cleanup –> tick enable access delegation –> secondary owner as below
When the user’s profile has been deleted, that user’s My site will be flagged for deletion after 3650 days. To prevent data loss, access to the former user’s My Site can be granted to the user’s manager or secondary My site owner. This gives the manager or secondary owner an opportunity to retrieve the content before deletion.
More information can be found in the article: “The my site of user is scheduled for deletion” email message in SharePoint 2013 and SharePoint Online.