Extending The Retention Period Of Orphaned Personal Site Collections Up To A Year



Alright! I guess you might have figured out what this post is about. Yes, I’m going to show you how to extend the retention period of the OneDrive for Business content upto a year even after the user has left the company.

I assume all the Office 365 folks as well as SharePoint folks out there would be aware of the “My site cleanup policy” that runs in SharePoint once a user’s account has been deleted in AD. If you’re not aware of this yet, please check my article on that. Also, to understand how this works on SharePoint Online, you can take a look at the link below. Microsoft has done an awesome job on writing a detailed article about this and hence, I’m not going to spend my time writing a detailed article explaining the same stuff once again.

https://support.microsoft.com/en-in/help/3042522/onedrive-for-business-retention-and-deletion

So, here in this article, I’m going to introduce you to a PowerShell command that will extend the retention period of the contents in the personal site (i.e. One Drive for Business) upto a year so that you have a year’s time to copy the content from a user’s One Drive for Business folder even after he/she has left the company.

I guess scenarios like this are quite possible when a user has been terminated and his account has been deleted or may be a user left the company and the default retention period was not sufficient for you to copy the important content from their One Drive for Business folder .

So here’s the PowerShell command for that.

Set-SPOTenant -OrphanedPersonalSitesRetentionPeriod 365

You need to run this as a SharePoint Online command, as shown in the image below.


Once done, it will update the retention policy for all the orphaned One Drive for Business sites in your tenant. The other way to do this is by putting a hold on the user’s One Drive for Business as a part of an eDiscovery case, and the site won’t get deleted until the hold is removed. But this command will make your life even easier by making the change for the entire tenant.

Happy SharePointing …..I hope this helps someone. Thanks to Chris Bortlik for showing this to us.