Forum Discussion
JakobRohde
Jan 04, 2019Iron Contributor
Adding an exception to existing retention policy
We have a retention policy in place that covers all SharePoint Online sites. I want to exclude a specific site from this policy, but if I add a site to the "Exclude sites" it looks like it removes th...
Jan 04, 2019
Unfortunately, the retention policy UI does not work in that way so you can only apply to all the sites or indicate the sites you want it to be applied
- JakobRohdeJan 04, 2019Iron Contributor
Thanks, Juan.
Can I instead add all sites in the GUI and the add exceptions using Powershell?
- Jan 04, 2019No,
What you can do through PowerShell is automate where you want to apply the retention policies in a less consuming task compared to use the UI. I will follow the bellow approach:
1) Create a list of the SPO sites where you want to apply the retention policy and store it in a CSV file
2) Iterate through the SPO sites list and use the Set-RetentionCompliancePolicy so each site is added to the scope of the policy https://docs.microsoft.com/en-us/powershell/module/exchange/policy-and-compliance-retention/set-retentioncompliancepolicy?view=exchange-ps