KB ID 0001620
Most things in Office 365 operate on a 30 day retention principle, but what if you are governed by restrictions that require you to retain your data for 5 years or 7 years in some cases? We have had Retention policies in Exchange for years, and I knew you could create a policy in exchange online, but what about OneDrive or SharePoint data?
Well with O365 you can specify a ‘top level’ retention policy that applies to ‘most’ of your data. I say most because some application data is not 100% retained.
BE AWARE: Despite the name containing ‘retention’ this is also how you specify when to automatically delete old files (if that is MORE your requirement).
From Office 365 admin > Admin Centers > Security and Compliance.
Information governance > Retention > Create.
Give your policy a name > Next.
Obviously we want to choose ‘Yes I want to retain’ > I would change the retain based on to ‘when it was last modified’ > Next.
Note: You can choose the second option to automatically delete files that are a certain age.
Note2: You can add a specific policy for files containing certain words/phrases or specific date i.e. financial, (at present this does not apply to Teams).
Specify ‘What’ you want to apply the policy to, by default it’s off for Skype and Teams Data, and Exchange public folders strangely? > Next.
Review the settings > Create this policy.
Office 365 Retention Policies via PowerShell
As usual, you can do similar things with PowerShell;
New-RetentionCompliancePolicy -Name "PeteNetLive-Retention-Policy" -ExchangeLocation All -SharePointLocation All -ModernGroupLocation All -OneDriveLocation All -Enabled $true
New-RetentionComplianceRule -Name "PeteNetLive-Retention-Policy-Rule" -Policy "PeteNetLive-Retention-Policy" -RetentionDuration 2555
Note: 2555 Days is 7 years.
Related Articles, References, Credits, or External Links