Quantcast
Channel: Exchange Server 2013 - Administration, Monitoring, and Performance 论坛
Viewing all articles
Browse latest Browse all 8719

Transport Rule Script - HELP

$
0
0

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

 


Viewing all articles
Browse latest Browse all 8719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>