Powershell – Exchange – enable/disable junk mail rule in a mailbox

Set-MailboxJunkEmailConfiguration -Enabled <$true | $false>

To check:


To disable the junk email rule on all mailboxes in Exchange:

$All = Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited
$All | foreach {
Set-MailboxJunkEmailConfiguration $_.Name -Enabled $false

Leave a Reply

Your email address will not be published. Required fields are marked *

4 × 5 =

This site uses Akismet to reduce spam. Learn how your comment data is processed.