Site icon Franky's Web

Exchange 2010: Edit junk mail filter rules with the Exchange Management Shell

Sometimes users complain that they have not received a certain e-mail. There can be many reasons for this. Occasionally, junk mail rules configured by the user are the reason. Fortunately, in addition to the Mailbox rules You can also manage the junk mail rules from the Management Shell. The following command is sufficient to display the rules for a mailbox:

Get-MailboxJunkEmailConfiguration -Identity frank

image

As you can see in this example, the user Frank has not configured any junk mail rules. To add an e-mail address to the blocked senders via shell, the following command is sufficient:

Set-MailboxJunkEmailConfiguration -Identity frank -BlockedSendersAndDomains spam1@spam.com,spam2@spam.com

The command adds the addresses spam1@spam.com and spam2@spam.com to the list of blocked senders.

image

Of course, the blocked sender also appears in Outlook:

Junk-Mail

This command can be used to delete all blocked senders:

Set-MailboxJunkEmailConfiguration -Identity frank -BlockedSendersAndDomains $NULL

Senders or domains can also be added to the safe senders list in the same way:

Set-MailboxJunkEmailConfiguration -Identity frank -TrustedSendersAndDomains keinespamdomain.de,nospam@noxpam.com

image

Of course, this can also be done for all mailboxes; in this example, the list of safe and blocked senders is deleted for all mailboxes:

Get-Mailbox | Set-MailboxJunkEmailConfiguration -BlockedSendersAndDomains $NULL -TrustedSendersAndDomains $NULL

And in very stubborn cases, the junk mail filter can also be switched off:

Set-MailboxJunkEmailConfiguration -Identity frank -Enabled $false

Exit mobile version