Dela via


Transport Rules

Whilst working for a customer they had a specific requirement to apply a disclaimer to all outbound mail e.g. not to apply disclaimers to mail sent to other users within the Exchange organisation. Their requirement also included to only apply the disclaimer if it had not already been applied (or where it contained the same text). So i created a powershell script to do this:-

 

Get-TransportRulePredicate SubjectOrBodyContains

$Action = get-TransportRuleAction ApplyDisclaimer

$Action.Text = “my test disclaimer”

Get-TransportRulePredicate SubjectOrBodyContains

$Exception = Get-TransportRulePredicate SubjectOrBodyContains

$Exception.Words = @("My test disclaimer”)

$Condition = Get-TransportRulePredicate SentToScope

$Condition.Scope = "NotInOrganization"

New-TransportRule –Name “My test” –Action @($Action) –Exception @($Exception) –Condition @($Condition)

 

Written by Daniel Kenyon-Smith