Create a Custom DSN Message and Code When Emailing Users

Description: This article will show you how to create a custom DNS (bounce back) message and code when someone try’s to email a user or users in a certain group. This is done by creating a custom Transport Rule.

  1. Create a new distribution group in Exchange
  2. Open Exchange Management Shell
  3. I have created a custom DSN when sending to a Distribution Group named Disabled-Email, the custom message is: “The user you have tried to contact no longer exists”
    Please note we will be setting the message for 5.7.10 below

  4. Add members that you want this bounce back message to apply to
  5. Below is the custom bounce back we get when attempting to send a message to someone in our Disabled-Email group. We see out custom message in Diagnostic Information for Administrators
  6. To create the custom message you see at “The mailbox you tried to send an e-mail to is disabled and is no longer accepting message. Please contact your Systems Administrator for more information.” we will use Exchange Management shell.
  7. In step 3 we specified using DSN code 5.7.10, to set the message for DSN code 5.7.10 open Exchange Management Shell
  8. Enter in the following to edit code 5.7.10
  9. The -Internal  $False will show this message to external users, if you put $True it will only show this message to internal users only
  10. Here is the code in production, since we specified using DSN code 5.7.10 above (step 3) is will display what we set as the message for DSN code 5.7.10
  11. Done!

Leave a Comment