Aug 01 2023 10:26 AM
I've been asked to create some retention policies for mailboxes using Purview.
Existing users should have an M365 retention policy that retains for 5 years.
Separated users, whose mailboxes have become Inactive Mailboxes, should have a 2 year retention and then delete.
To do that, I thought I'd create two separate policies targeting different adaptive scopes. The first is pretty easy, any active mailbox.
The second - well I am not having much success getting a query to find Inactive Mailboxes that are 2 years old or newer. Is it possible to use the utcNow() function within an adaptive scope query? Something like:
(IsInactiveMailbox -eq "True") -and (WhenSoftDeleted -lt 'addDays(utcNow(),-730)')
it errors out on that last ' ... 82nd character.
Aug 15 2023 12:25 PM
Hi @MC_Edwards,
There is an error in the setup. Here are the steps:
For the active user policy, I would follow the same steps, except use this query for the adaptive scope, just to ensure there is absolutely no overlap: IsInactiveMailbox -eq "False"
Here's a blog post about working with adaptive scopes + mailboxes: Using Adaptive Policy Scopes to Apply M365 Retention to Shared, Resource, and Inactive Mailboxes - M...