Export (0) Print
Expand All

How to Rewrite All E-Mail Messages from Sub-Domains

 

Applies to: Exchange Server 2007 SP3, Exchange Server 2007 SP2, Exchange Server 2007 SP1, Exchange Server 2007

Topic Last Modified: 2007-08-13

This topic explains how to use the Exchange Management Shell to create a new address rewrite entry that rewrites all e-mail messages that are sent from multiple sub-domains on a computer that has the Microsoft Exchange Server 2007 Edge Transport server role installed. You can create the following types of address rewrite entries when you rewrite multiple sub-domains:

  • Address rewrite entries that affect all your sub-domains
  • Address rewrite entries that affect only specific sub-domains
  • Address rewrite entries that affect all sub-domains except those sub-domains that you identify as exceptions
noteNote:
You cannot administer the Address Rewriting agent by using the Exchange Management Console. To administer the Address Rewriting agent, you must use the Exchange Management Shell. For more information about how to use the Exchange Management Shell, see Using the Exchange Management Shell.

For more information about address rewriting, see Planning for Address Rewriting.

To perform the following procedures on a computer that has the Edge Transport server role installed, you must log on by using an account that is a member of the local Administrators group on that computer.

Also, before you perform these procedures, read How to Create a New Address Rewrite Entry.

CautionCaution:
You must prepare your sub-domains before you create an address rewrite entry that rewrites multiple domains. For more information, see Preparing to Rewrite Addresses in Multiple Domains.

The New-AddressRewriteEntry cmdlet includes the TemplateInstance parameter. The TemplateInstance parameter lets you copy the configuration of one address rewrite entry to another address rewrite entry. The properties that are available for copying on address rewrite entries are the OutboundOnly property and the ExceptionList property. For more information about how to use an existing address rewrite entry as a template, see Templates.

To create an address rewrite entry that rewrites the headers of all e-mail messages for all sub-domains, use the following command syntax:

New-AddressRewriteEntry -Name <address rewrite entry name> -InternalAddress <*.internal domain> -ExternalAddress <external domain> -OutboundOnly $True

  • Run the following command:

    New-AddressRewriteEntry -Name "Rewrite all contoso.com sub-domains" -InternalAddress *.contoso.com -ExternalAddress contoso.com -OutboundOnly $True 
    

To create an address rewrite entry that rewrites the headers of e-mail messages from specific domains in Exchange 2007 SP1, use the following command syntax:

New-AddressRewriteEntry -Name <address rewrite entry name> -InternalAddress <internal domain 1> -ExternalAddress <external domain> -OutboundOnly $True
New-AddressRewriteEntry -Name <address rewrite entry name> -InternalAddress <internal domain n> -ExternalAddress <external domain> -OutboundOnly $True

  • Run the following commands:

    New-AddressRewriteEntry -Name "Rewrite sales.contoso.com to contoso.com" -InternalAddress sales.contoso.com -ExternalAddress contoso.com -OutboundOnly $True
    New-AddressRewriteEntry -Name "Rewrite marketing.contoso.com to contoso.com" -InternalAddress marketing.contoso.com -ExternalAddress contoso.com -OutboundOnly $True
    New-AddressRewriteEntry -Name "Rewrite research.contoso.com to contoso.com" -InternalAddress research.contoso.com -ExternalAddress contoso.com -OutboundOnly $True
    

To create an address rewrite entry that rewrites the headers of e-mail messages from specific domains in Exchange 2007 RTM, use the following command syntax:

New-AddressRewriteEntry -Name <address rewrite entry name> -InternalAddress <*.internal domain 1> -ExternalAddress <external domain> -OutboundOnly $True
New-AddressRewriteEntry -Name <address rewrite entry name> -InternalAddress <*.internal domain n> -ExternalAddress <external domain> -OutboundOnly $True

  • Run the following commands:

    New-AddressRewriteEntry -Name "Rewrite sales.contoso.com to contoso.com" -InternalAddress *.sales.contoso.com -ExternalAddress contoso.com -OutboundOnly $True
    New-AddressRewriteEntry -Name "Rewrite marketing.contoso.com to contoso.com" -InternalAddress *.marketing.contoso.com -ExternalAddress contoso.com -OutboundOnly $True
    New-AddressRewriteEntry -Name "Rewrite research.contoso.com to contoso.com" -InternalAddress *.research.contoso.com -ExternalAddress contoso.com -OutboundOnly $True
    

To create an address rewrite entry that rewrites the headers of all e-mail messages for all sub-domains except for specific sub-domains, use the following command syntax:

New-AddressRewriteEntry -Name <address rewrite entry name> -InternalAddress <*.internal domain> -ExternalAddress <external domain> -OutboundOnly $True -ExceptionList <excluded domain name 1, excluded domain name 2>

  • Run the following command:

    New-AddressRewriteEntry -name "Rewrite all contoso.com sub-domains except legal.contoso.com" -InternalAddress *.contoso.com -ExternalAddress contoso.com -OutboundOnly $True -ExceptionList legal.contoso.com, corp.contoso.com
    

For detailed syntax and parameter information, see New-AddressRewriteEntry.

For more information about address rewriting, see the following topics:

To ensure that you are reading the most up-to-date information and to find additional Exchange Server 2007 documentation, visit the Exchange Server TechCenter.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft