Forum Discussion

Anonymous's avatar
Anonymous
Aug 28, 2016
Solved

Setup Auto Reply from email addresses

Hello All,

 

We are almost finishing the integration project with another email domain. We are planning to set up an automated response for 150+ users for their legacy email addresses.

 

How do we setup auto response when some one email them on their legacy email address for e.g. james.bond@abc.com to be auto responded as this email address no more exist please send email to james.bond@xyz.com?

 

this needs to be done for all 150 users. Any idea?

  • You can use the below script to get this done. 

     

    $NewdomainName="@xyz.com"
    $Mailboxs=get-mailbox -resultsize unlimited | Where { $_.RecipientTypeDetails -eq ‘LegacyMailbox’ } 
    Foreach($Mailbox in $mailboxs)
    {
    $Message="email address no more exist please send email to"+$Mailbox.Alias+$NewdomainName
    Set-MailboxAutoReplyConfiguration -Identity $Mailbox.Identity -AutoReplyState scheduled -InternalMessage $Message -ExternalMessage $Message
    } 

7 Replies

  • Dan_Snape's avatar
    Dan_Snape
    Bronze Contributor
    Set up a transport rule for messages sent to that mail domain and reject the message with a an explanation why (NDR). There might even be a way to still accept the message and send some form of reply to the sender
    • Anonymous's avatar
      Anonymous

      Thanks Dan.

       

      But that will not work as we need to give the senders the correct email address as well while replying back :)

      • SanthoshB1's avatar
        SanthoshB1
        Bronze Contributor

        You can use the below script to get this done. 

         

        $NewdomainName="@xyz.com"
        $Mailboxs=get-mailbox -resultsize unlimited | Where { $_.RecipientTypeDetails -eq ‘LegacyMailbox’ } 
        Foreach($Mailbox in $mailboxs)
        {
        $Message="email address no more exist please send email to"+$Mailbox.Alias+$NewdomainName
        Set-MailboxAutoReplyConfiguration -Identity $Mailbox.Identity -AutoReplyState scheduled -InternalMessage $Message -ExternalMessage $Message
        } 
    • Anonymous's avatar
      Anonymous

      Thanks Santosh.

       

      Looking at the drawback i dont think it will be a viable solution. As our requirement is to fire auto response from all 150 users. so Mail flow rule i guess not viable one. Coming back to powershell we want the rule to fire only when it hit legacy address of the email.

       

      Thanks