Office 365: Microsoft 365: List all Outlook Inbox Rules created by the User

Reference:

https://sid-500.com/2020/09/08/office-365-list-all-outlook-inbox-rules-created-by-the-user/ - and -

https://sid-500.com/2020/06/30/microsoft-365-list-all-mailbox-forwarding-rules-server/


PowerShell is the tool you need to list all inbox rules of all users in your environment. In this blog post I will show how to connect to Exchange Online to afterwards retrieve all outlook inbox rules created by the user. Let’s dive in.

Connect to Microsoft 365 / Exchange Online

First we need to connect to our tenant. Run the commands below to open a PowerShell session to your Microsoft cloud.

  1. Install-Module -Name ExchangeOnlineManagement -Force -AllowClobber
  2. Connect-ExchangeOnline -UserPrincipalName user@domain.com -ShowProgress $true

Fine. Let’s move on.


List Inbox Rules from all users

We are now ready to get a list of all rules created by the user. Run the command below to get them all.

  1. Get-ExoMailbox -ResultSize Unlimited | 
  2. Select-Object -ExpandProperty UserPrincipalName | 
  3. Foreach-Object {Get-InboxRule -Mailbox $_ | 
  4. Select-Object -Property MailboxOwnerID,Name,Enabled,From,Description,RedirectTo,ForwardTo}

Listing Mailbox Forwarding Rules

Copy and paste the code below into your Microsoft 365 PowerShell session to list all mailbox server forwarding rules.

  1. Get-Mailbox -ResultSize Unlimited `
  2. -Filter "ForwardingAddress -like '*' -or ForwardingSmtpAddress -like '*'" |
  3. Select-Object Name,ForwardingAddress,ForwardingSmtpAddress