forward Distribution Group to a Mailbox with Filters

This topic contains 0 replies, has 1 voice, and was last updated by Profile photo of Forums Archives Forums Archives 5 years, 6 months ago.

  • Author
    Posts
  • #6510

    by jtmoney at 2013-02-01 06:24:15

    Hi Guys,

    This is my first post, hope it makes sense.
    The task I have been given is to: forward a DG to a Mailbox but filter some of the mail to a different destination.
    So: we have a DG (distribution Group) called 'Support' and we want to forward this to a MB (mailbox) called 'Helpdesk', but filter out some of this mail so it stays in Support. For example, if we wanted all mail to flow from support to helpdesk other than mail from gmail, could this be done with powershell?

    Thanks
    Jeff

    by nate-n8 at 2013-02-01 11:06:36

    you might want to look into Transport Rules

    by Takuu at 2013-02-04 08:39:40

    This can be done with powershell, but is probably easier to do in the GUI. I don't make that many transport rules, so I don't usually use Powershell for this. Here is the Powershell for what you are talking about though.
    $Condition = Get-TransportRulePredicate SentToMemberOf
    $Condition.Addresses = "distributionlist@domain.com"
    $Exception = Get-TransportRulePredicate FromAddressMatches
    $Exception.Patterns = { @gmail.com }
    $Action = Get-TransportRuleAction RedirectMessage
    $Action.Addresses = "mailbox@domain.com"
    new-TransportRule -Name 'DG Reroute' -Comments 'testing' -Condition @($Condition) -Actions @($Action) -Exception @($Exception) -Enabled $true -Priority '3'

    by jtmoney at 2013-02-05 02:40:35

    On the advice of nate-n8, I have used a simple transport rule that as of yet does not work.
    The rules states:
    When a recipient address contains 'support'
    Redirect the message to 'Helpdesk@.....co.uk
    Except when the from address contains 'Hotmail'

    I thought this was simple enough except when i sent email to support from hotmail or gmail it ends up in support, where gmail should end up at helpdesk?

    The powershell that TAKUU sent did not work either.

    Any help

    Jeff

    by jtmoney at 2013-02-05 04:00:50

    I have managed to get a rule to work, but the difference is that the rule that works concerns a Universal Distribution group as oposed to a Universal Security group. If this is the issue, can you convert security groups to distribution groups?

    Thanks

    Jeff

    by jtmoney at 2013-02-06 07:56:20

    This code works and blocks gmail and btinternet from Helpdesk, but what I need is to block all mail from helpdesk other than gmail and btinternet

    New-TransportRule -Name 'SupportL' -Comments " -Priority '0' -Enabled $true -AnyOfToHeader 'Support@xxxx.co.uk' -RedirectMessageTo 'helpdesk@xxxx.co.uk' -ExceptIfFromAddressContainsWords 'gmail','btinternet'

    Thanks

    jeff

You must be logged in to reply to this topic.