Exchange Transport Rule that puts everything tagged with Junk into the junk folder

Posted on 2012-09-02
Last Modified: 2012-09-07
We have a 3rd party tool that marks susspected spam as *junk* I am trying to create a new transport rule that puts everything with *junk* in the subject into the junk folder.

I have created the following script but its not working.

Please see the attachment for the error I am receiving.  

$condition = Get-TransportRulePredicate SubjectContains
$condition.Words = ,"*junk*"
$action = Get-TransportRuleAction SetScl
$action.SclValue = 9
New-TransportRule -Name "Set SCL from *junk*" -Conditions @($condition) -Action @($action) -Enabled: $true

Question by:vmdude
    LVL 52

    Expert Comment

    There isnt a Switch with -Condition thats why it cannot work.


    - Rancy
    LVL 6

    Accepted Solution

    Thanks for the quick response Randy.

    On second inspection I was able to set this rule with the GUI. For some reason I didn't think this condition could be set this way but it can be.

    Wouldbe nice to get the command line working but if it works it works!
    LVL 52

    Expert Comment

    Whenever you run anything through GUI in Emc at the end it will show you what command was run in the back ground for you to have a look into it. You can use that always for future reference or playing around with it :)

    - Rancy
    LVL 6

    Author Closing Comment

    Fixed problem myself and updated the thread with reasoning

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Suggested Solutions

    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    This video discusses moving either the default database or any database to a new volume.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now