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
If you have Office 365 Germany, sign in to the Microsoft 365 admin center, then browse to the SharePoint admin center and open the Sharing page.
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.