0365 graphic

Question: When an Office 365 user account is deleted, what happens to that user’s files in OneDrive for Business?

Answer: Azure Active Directory (AD) is used to store the accounts and attributes for users of the Office 365 services, such as OneDrive for Business or Exchange Online. Once a user account is deleted in Azure Active Directory, the OneDrive Clean Job Up runs and the user profile is marked for deletion. This is the start of the retention period which lasts for 30 days by default. To change the retention period, use the PowerShell command, Set-SPOTenant, with the OrphanedPersonalSitesRetentionPeriod parameter set in the range of 30 to 3,650 days.

If the “Manager” attribute is populated for the user in Azure AD, the manager will receive an email alert about the cleanup. However, if the “Manager” attribute is not defined, then the email alert will be sent to the secondary site collection administrator if one is configured. Each user’s OneDrive is a separate SharePoint Online site collection, with the user being the primary site collection administrator for their own OneDrive. We recommend evaluating whether defining a secondary site collection administrator for your users’ OneDrive site collections would be the best approach for your organization. Having a secondary site collection administrator aids in troubleshooting issues a user has with OneDrive, and in assisting with the retention of data after a user account is deleted. Further information on secondary administrators can be found here.

After the end of the retention period (30 days by default), the site collection containing the user’s OneDrive data is deleted and sent to the site collection recycle bin for your Office 365 tenancy. It won’t show in the web browser interface for that recycle bin, but you can manage it using PowerShell commands.
For example, using the following PowerShell command after you have connected to SharePoint Online will give you a list of deleted OneDrive sites

Get-SPODeletedSite -IncludeOnlyPersonalSite

It is important to note that disabling a user account, or even removing a OneDrive license from a user account, will not initiate the cleanup process. Rather, it is the deletion of the user account from Azure Active Directory that causes the OneDrive cleanup process to start. Further information on OneDrive for Business retention and deletion can be found here.