Associate Retention Policy to mailboxes based on criteria

Niranjan T Pattana Shetty 286 Reputation points
2022-02-16T17:40:19.38+00:00

Hi All,
I am thinking to create a couple of retention Policy for Exchange Online mailboxes and to associate/implement them automatically onto mailboxes that matches a couple of criterias, like matching certain AD attricutes.
I was looking for which all ways we can execute this?
One approach I can think of is, create a script and then run the script regularly using Task Scheduler. But, I am looking more efficient options , like can we use Azure Groups/AD groups to achieve this? Or Powerapps can be used to create a flow and implement the policies on mailboxes.
I could see one option in Office365 is to create Adaptive Retention Polcies, but this will need an E5 license which we do not have in our infra currently. Kindly, suggest an approach here.

Many Thanks,
Niru

Windows
Windows
A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.
4,799 questions
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,212 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,368 questions
Microsoft 365 Publishing
Microsoft 365 Publishing
Microsoft 365: Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line. Publishing: The process of preparing, producing, and releasing content for distribution or sale.
598 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 43,966 Reputation points
    2022-02-23T11:18:22.917+00:00

    Hello @Niranjan T Pattana Shetty

    Yes, this is possible, at least with OUs in your organization, for example:

    Get-Mailbox -OrganizationalUnit "Marketing" -ResultSize Unlimited | Set-Mailbox -RetentionPolicy "RetentionPolicy-Marketing"

    For detailed syntax and parameter information, see
    https://learn.microsoft.com/en-us/powershell/module/exchange/get-mailbox?view=exchange-ps
    https://learn.microsoft.com/en-us/powershell/module/exchange/set-mailbox?view=exchange-ps

    Hope this helps with your query,

    --
    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments

  2. Niranjan T Pattana Shetty 286 Reputation points
    2022-03-01T13:53:20.873+00:00

    Hi @Limitless Technology

    Thanks for the suggestion, yes I am looking to utilise a PS script and have it Task run at regular intervals, but want to do that if at all this ask is not possible via any Office365 development tools like Power Apps, or Power Automate or Azure AD groups.....

    0 comments No comments