hi everybody,
i am trying to create another transport rule on an exchange server 2007 in powershell.
this rule is supposed to check the mail header for certain texts. in that case it should forward
the message as bcc. it is part of a bigger script to automate the creation of project mailboxes.
$short = "test_02" $shortCollector = "test_02.collector" #create transport rule - >replyTo< $Condition1 = Get-TransportRulePredicate HeaderContains $mywords = @($short + "@mycompany") $mywords = $mywords + "cn=$short" $Condition1.messageHeader = @($mywords) $Action1 = Get-TransportRuleAction BlindCopyTo $ADOCollector = get-mailbox $shortCollector | select -expand userprincipalname $Action1.Addresses = @(get-mailbox $shortCollector) $RULE_name = $short + " out(replyTo)" New-TransportRule -name $RULE_name -Condition @($Condition1) -Action @($Action1)
it does not work as intended as i get another error like
...Cannot convert the "System.Object[]" value of type "System.Object[]" to type"Microsoft.Exchange.MessagingPolicies.Rules.Tasks.HeaderName".
any ideas how i can convert correctly?
thank you - best regards
marc