I am working on a script to create multiple hub transport rules in Exchange 2010.
My code is:
`
$names=@(‘foo’,‘bar’)
foreach ($name in $names) {
set-transportrule -identity “export” + $name + “test redirect domain1 to domain2” -sentto=$name+@domain1.org -redirectmessageto=$name +@domain2.org -state=disabled
}
`
Is my set-transportrule line written correctly?? (in terms of syntax??)
I know the other lines are syntactically correct (array, foreach)
This is a multi-line script. Do I start it as a *.ps1 script inside the Exchange PS Shell, or what??
Thank you, Tom