# Mailbox Rules

Check:

<pre class="language-powershell"><code class="lang-powershell">Install-Module -Name ExchangeOnlineManagement -Force -AllowClobber
<strong>Connect-ExchangeOnline  -UserPrincipalName bdfir@test.com -ShowProgress $true
</strong><strong>
</strong>get-inboxrule -Mailbox mailbox@test.com
Get-ExoMailbox -ResultSize Unlimited | Select-Object -ExpandProperty UserPrincipalName | Foreach-Object {Get-InboxRule -Mailbox $_ | Select-Object -Property MailboxOwnerID,Name,Enabled,From,Description,RedirectTo,ForwardTo} | Export-csv MailboxRules.csv
</code></pre>

Delete:

```powershell
Install-Module -Name ExchangeOnlineManagement -Force -AllowClobber
Connect-ExchangeOnline -UserPrincipalName "<your O365 admin email address>"
Get-InboxRule -Mailbox "<user email address>"
Remove-InboxRule -Mailbox "<user email address>" -Identity "<rule name>"
Get-InboxRule -Mailbox "<user email address>"
```
