create folder, mail flow rule and retention policy for all users

McChan Rawson 0 Reputation points
2023-03-02T16:21:51.8666667+00:00

Hi there, I am trying to get this working for our organization where we have about 50 user mailboxes already and I would like to automate the process of creating a scans folder in their mailbox, then create a mail flow rule to take anything from scanner@ourdomain.com and put it directly into the folder and finally set a retention period of 24 hours to that folder. Is this possible in powershell and could somebody point me in the right direction or help out with it?

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,166 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,037 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 43,926 Reputation points
    2023-03-03T16:15:51.86+00:00

    Hello there,

    You can use a task scheduler or Powersutomate to automate your tasks once you have done with your Powershell script.

    Some useful article links that might throw some insights are listed below

    PowerShell - Managing an Outlook Mailbox with PowerShell https://learn.microsoft.com/en-us/archive/msdn-magazine/2013/march/powershell-managing-an-outlook-mailbox-with-powershell

    Mail flow rules (transport rules) in Exchange Online https://learn.microsoft.com/en-us/exchange/security-and-compliance/mail-flow-rules/mail-flow-rules

    New-InboxRule https://learn.microsoft.com/en-us/powershell/module/exchange/new-inboxrule?view=exchange-ps

    Hope this resolves your Query !!

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

    0 comments No comments

  2. Limitless Technology 43,926 Reputation points
    2023-03-03T16:16:09.7933333+00:00

    Use answers to provide solutions to the user's question.

    Hello there,

    You can use a task scheduler or Powersutomate to automate your tasks once you have done with your Powershell script.

    Some useful article links that might throw some insights are listed below

    PowerShell - Managing an Outlook Mailbox with PowerShell https://learn.microsoft.com/en-us/archive/msdn-magazine/2013/march/powershell-managing-an-outlook-mailbox-with-powershell

    Mail flow rules (transport rules) in Exchange Online https://learn.microsoft.com/en-us/exchange/security-and-compliance/mail-flow-rules/mail-flow-rules

    New-InboxRule https://learn.microsoft.com/en-us/powershell/module/exchange/new-inboxrule?view=exchange-ps

    Hope this resolves your Query !!

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

    0 comments No comments