Please Read: Significant Update Planned, Migrating Forum Software This Month

See more
See less

New-InboxRule to move spam

  • Filter
  • Time
  • Show
Clear All
new posts

  • New-InboxRule to move spam


    I'm trying to use the New-InboxRule to make emails that contain a specific word in the subject get moved to the users Junk E-mail folder. While I want a script to apply this to all users, I'd like to make it work for just one first.

    I though the command to use would be one of these, but either one does not run and puts me at a >> prompt.

    New-InboxRule -name "SPAM" -Mailbox "John Doe" -MoveToFolder"John Doe\Junk E-Mail" -SubjectContainsWords "***SPAM***"
    New-InboxRule -name "SPAM" -Mailbox [email protected] -MoveToFolder"[email protected]\Junk E-Mail" -SubjectContainsWords "***SPAM***"

    Please help me to stop punding my head on the desk

  • #2
    Re: New-InboxRule to move spam

    Too much work.

    Install the antispam agents using the Script in Scripts directory of the installation point. After doing so, restart the Exchange Transport Service.
    Go in to EMC, and disable all of the agents except content filtering. In to the properties of the Content Filtering, disable all of the SCL values.
    Then use set-mailbox to configure SCL Junk E-mail folder threshold to 8.

    Finally configure a Transport rule to look for messages with your subject line and set the SCL value to 9.

    That will force the email to go in to Junk Email folder.
    The only thing that you will have to remember to do is set the SCL Junk E-mail folder threshold on every new mailbox, but you would have to do that with your rules anyway. If you are creating high numbers of mailboxes, then script it to run the rule over all mailboxes and set it on a schedule.

    Simon Butler
    Exchange MVP

    More Exchange Content:
    Exchange Resources List:
    In the UK? Hire me:

    Sembee is a registered trademark, used here with permission.