- This topic has 2 replies, 3 voices, and was last updated 1 year, 8 months ago by
September 18, 2018 at 3:17 pm #112031ParticipantTopics: 1Replies: 0Points: 1Rank: Member
I have already created a new transport rule using the “New-TransportRule”.
But now I wish to modify the existing transport rule using the “Set-TransportRule”.
I wish to add three more additional email addresses to the existing email addresses without affecting the remaining Properties.
Get-Transportrule “MOFIS Redirect” | fl FromAddressMatchesPatterns
If I ran this command would it append to existing email addreses without affecting the remaining Properties?
Set-Transportrule “MOFIS Redirect” -FromAddressMatchesPatterns “firstname.lastname@example.org”,”email@example.com”,”firstname.lastname@example.org” -RedirectMessageTo “email@example.com”
September 18, 2018 at 8:35 pm #112046ParticipantTopics: 1Replies: 302Points: 147Rank: Participant
The documentation on this is not very helpful, is it?
I’m not familiar with the cmdlet but everything I’ve read suggests that existing addresses will be overwritten. The general consensus is that you have to update the collection. e.g
$collection = New-Object Collections.ArrayList $collection = Get-Transportrule "MOFIS Redirect" | Select -ExpandProperty FromAddressMatchesPatterns $collection += 'firstname.lastname@example.org','email@example.com','firstname.lastname@example.org','email@example.com' Set-Transportrule "MOFIS Redirect" -FromAddressMatchesPatterns $collection -RedirectMessageTo "firstname.lastname@example.org"
September 19, 2018 at 5:45 pm #112138ParticipantTopics: 2Replies: 31Points: 48Rank: Member
Yes, the list of addresses will definitely get overwritten. I verified with my own testing. You will need to include the original email addresses in the list of additional ones. You can add all of the addresses in a text file and use the get-content command as the parameter input:
Set-TransportRule "MOFIS Redirect" -FromAddressMatchesPatterns (get-content c:\addresses.txt)
- The topic ‘How to use set-transportrule’ is closed to new replies.