Google
Search WWW Search msexchangetips.blogspot.com

Tuesday, April 21, 2009

Exchange 2007: The sequence of predicates is invalid

Summary: When creating a transport rule I got the following error: "The sequence of predicates is invalid" In this case it appears that the order or predicate rules mattered.

In this example, I was creating a rule to silently drop all messsages coming in from an external address to an internal address.

$Condition = Get-TransportRulePredicate FromAddressContains
$Condition1 = Get-TransportRulePredicate SentTo
$Condition.words = @("externaluser1@gmail.com","externaluser2@gmail.com")
$Condition1.addresses = @(get-mailbox user1)
$Action = Get-TransportRuleAction DeleteMessage
New-TransportRule -Name "Deny Senders to Cellulardeals" -Condition @($Condition,$condition1) -Actions @($Action)

This would yield "The sequence of predicates is invalid" However after swapping the condition to put SentTo before FromAddressContains it works fine.

$Condition = Get-TransportRulePredicate SentTo
$Condition.addresses = @(get-mailbox user1)
$Condition1 = Get-TransportRulePredicate FromAddressContains
$Condition1.words = @("externaluser1@gmail.com","externaluser2@gmail.com")
$Action = Get-TransportRuleAction DeleteMessage
New-TransportRule -Name "Deny Senders to Cellulardeals" -Condition @($Condition,$condition1) -Actions @($Action)



James Chong (MVP)
MCITP | EMA; MCSE | M+, S+
Security+, Project+, ITIL
msexchangetips.blogspot.com

4 Comments:

Anonymous Exchange email hosting said...

One of our systems guys got this error and it took him quite a while to sort it out. It's scary, but this blog really helps!

1:08 AM  
Blogger Alan said...

its excellent
Really i like this blog.
Its highly informative I would invite you to take tour on my website which also related Exchange Hosted.For more information about Web Hosting please visit on http://www.prestigetechnologies.com
I hope you like it most.

11:06 PM  
Blogger longge said...

The replica handbags design debuted in 1888. replica handbags uk design was launched in an effort to counteract the replicas his competitors were marketing. replica bags was made of an intersection of the initials LV, finished with a curved beige diamond and 4 point star intes.

6:50 PM  
Blogger Simple Luxury said...

Burberry Outlet Store Online
Handbags Outlet Store Online


www.burberry-outlets.org
www.prada-outlet.org

8:53 AM  

Post a Comment

<< Home

xml:lang="en" lang="en"> MS Exchange Tips: Exchange 2007: The sequence of predicates is invalid