Link to home
Start Free TrialLog in
Avatar of vmdude
vmdudeFlag for United Kingdom of Great Britain and Northern Ireland

asked on

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

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

Thanks!
Junk.PNG
Avatar of Manpreet SIngh Khatra
Manpreet SIngh Khatra
Flag of India image

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

New-TransportRule
http://technet.microsoft.com/en-us/library/bb125138.aspx

- Rancy
ASKER CERTIFIED SOLUTION
Avatar of vmdude
vmdude
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
Avatar of vmdude

ASKER

Fixed problem myself and updated the thread with reasoning