Set the OneDrive retention for deleted users
If a user's Microsoft 365 account is deleted, their OneDrive files are preserved for a period of time. You can set this time period.
To set the retention time for OneDrive accounts
Go to Settings in the new SharePoint admin center, and sign in with an account that has admin permissions for your organization.
If you have Office 365 operated by 21Vianet (China), sign in to the Microsoft 365 admin center, then browse to the SharePoint admin center and open the Sharing page.
Select the Retention setting.
Enter a value from 30 through 3650 in the Days to retain files a deleted user's OneDrive box.
The setting is activated for the next user that is deleted as well as any users that are in the process of being deleted. The count begins as soon as the user account was deleted in the Microsoft 365 admin center, even though the deletion process takes time.
Delete a user from your organization
Set up OneDrive to alert managers and delegate access automatically when users leave your organization
Submit and view feedback for