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
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