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

image

4 thoughts on “Exchange 2010: Junk-Mail Filter Regeln mit der Exchange Management Shell bearbeiten”

  1. Hallo,

    ist es auch möglich am Exchange alles Postfächer nach Blockierten Absendern der Nutzer zu fragen und diese direkt in die Absenderfilterung des Servers zu übernehmen (somit also quasi für alle Nutzer zu übernehmen)?

    Vielen Dank,
    Gruß
    Tom

    Reply
  2. Hi,

    oder man verwendet diesen Befehl:

    Set-MailboxJunkEmailConfiguration -Identity xname -BlockedSendersAndDomains @{Add=“spam2@spam.de“}

    Dann werden die neuen Adressen angefügt.

    Reply
    • Hi,

      korrekt, der Befehl setzt die Werte und fügt keine Werte hinzu. Wenn du Werte zur bestehenden Liste hinzufügen möchtest, musst du vorher die Liste der TrustedSenders auslesen und in einer Variablen speichern, zu der Variable, kannst du dann deine zusätzlichen Werte hinzufügen und wieder setzen lassen.

      Gruss, Frank

      Reply

Leave a Comment