
Explanation:

This example creates a transport rule with the following condition:
Between distribution list and distribution list. The first condition property value is the distribution group Sales-Group. The second condition property value is the distribution group Brokerage-Group.
The rule also has the following exceptions:
* With text patterns in the subject. The value for this exception is Press Release or
Corporate Communication.
* From people. The values for this exception are the users Tony Smith and Pilar
Ackerman.
The following action will be applied to any messages that match the "Between distribution list and distribution list" condition, but doesn't match the "with text patterns in the subject" or
"from people" exceptions:
* Send reject message to sender The value for this action is: Email messages sent between the Sales department and the Brokerage department are prohibited.
New-TransportRule "BlockMessagesBetweenSalesAndBrokerage" -BetweenMemberOf1
"Sales-Group" -BetweenMemberOf2 "Brokerage-Group" -ExceptIfFrom "Tony Smith","Pilar
Ackerman" -ExceptIfSubjectContainsWords "Press Release","Corporate Communication" -
RejectMessageEnhancedStatusCode "5.7.1" -RejectMessageReasonText "Email messages sent between the Sales department and the Brokerage department are prohibited."