• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1024
  • Last Modified:

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
0
vmdude
Asked:
vmdude
  • 2
  • 2
1 Solution
 
Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
There isnt a Switch with -Condition thats why it cannot work.

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

- Rancy
0
 
vmdudeAuthor Commented:
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!
0
 
Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
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
0
 
vmdudeAuthor Commented:
Fixed problem myself and updated the thread with reasoning
0

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now