Hi guys,
I intend to create a Transport Rule to prohibit emails arriving on the mailbox "VIP".
The script is:
$Condition = Get-TransportRulePredicate SentTo
$Condition.Addresses = @
$Condition2 = Get-TransportRulePredicate FromScope
$Condition2.Scope = "NotInOrganization"
$Action = Get-TransportRuleAction RejectMessage
$Action.RejectReason = “E-mail messages sent to VIP are prohibited.”
New-TransportRule -Name "VIP Rule" -Condition @($Condition, $Condition2) -Action @($Action)
When I run this the result is an error:
New-TransportRule : The sequence of predicates is invalid.
Parameter name: Conditions
At line:1 char:18
+ New-TransportRule <<<< -Name "VIP Rule" -Condition @($Condition, $Condition2)
-Action @($Action)
+ CategoryInfo : InvalidArgument: (:) [New-TransportRule], ArgumentException
+ FullyQualifiedErrorId : ACD0D640,Microsoft.Exchange.MessagingPolicies.Rules.Tasks.NewTransportRule
If anyone can help me I appreciate.
Thanks in advance.
Luiz