Create an Address Rewrite Entry
Applies to: Exchange Server 2010 SP3, Exchange Server 2010 SP2
You can use the Shell to create an address rewrite entry on a computer that has the Microsoft Exchange Server 2010 Edge Transport server role installed. For more information about address rewriting, see Understanding Address Rewriting.
Looking for other management tasks related to transport agents? Check out Managing Transport Agents.
Note
The Address Rewriting Inbound agent and the Address Rewriting Outbound agent must be enabled so that address rewrite entries are applied to e-mail messages that enter and leave the Edge Transport server. If address rewrite entries have been created, but the Address Rewriting agents are disabled, Exchange 2010 won't apply the address rewrite entries.
Use the Shell to verify that Address Rewriting agents are enabled
You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Address Rewriting agent" entry in the Transport Permissions topic.
Note
You can't use the EMC to verify that Address Rewriting agents are enabled.
This example verifies whether Address Rewriting agents are enabled on the Edge Transport server. Make sure that the Address Rewriting Inbound and Address Rewriting Outbound agents are enabled.
Get-TransportAgent
For detailed syntax and parameter information, see Get-TransportAgent.
Use the Shell to enable Address Rewriting agents
You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Address Rewriting agent" entry in the Transport Permissions topic.
Note
You can't use the EMC to enable Address Rewriting agents.
This example enables the Address Rewriting agents if they aren't enabled.
Enable-TransportAgent -Identity "Address Rewriting Inbound agent"
Enable-TransportAgent -Identity "Address Rewriting Outbound agent"
For detailed syntax and parameter information, see Enable-TransportAgent.
Use the Shell to rewrite a single e-mail address
You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Address Rewriting agent" entry in the Transport Permissions topic.
Note
You can't use the EMC to rewrite a single e-mail address.
You can rewrite the headers of e-mail messages sent to and from specific internal e-mail addresses when messages are sent to and from the Internet.
When you configure Exchange 2010 to rewrite a single e-mail address, the headers of e-mail messages sent to and from that e-mail address are rewritten. For example, the internal address joe@contoso.com can be rewritten so that it appears to be support@contoso.com when e-mail is sent from that account to the Internet. When replies to that e-mail address or new messages to that address arrive, Exchange 2010 rewrites the recipient address in the header of the inbound messages by using the internal address joe@contoso.com.
When you rewrite e-mail addresses, there is a one-to-one correlation between the internal e-mail address and the external e-mail address. This correlation enables Exchange 2010 to automatically rewrite e-mail messages to and from the Internet.
This example creates an address rewrite entry that rewrites a single e-mail address.
New-AddressRewriteEntry -name "joe@contoso.com to support@northwindtraders.com" -InternalAddress joe@contoso.com -ExternalAddress support@northwindtraders.com
For detailed syntax and parameter information, see New-AddressRewriteEntry.
Use the Shell to rewrite a single domain
You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Address Rewriting agent" entry in the Transport Permissions topic.
Note
You can't use the EMC to rewrite a single domain.
You can rewrite the headers of e-mail messages sent to and from recipients that send messages from specific internal domain names when messages are sent to and from the Internet.
For example, in the following procedure, the headers of e-mail messages sent from mailboxes in the internal contoso.com domain are rewritten so that the messages appear to originate from the fabrikam.com domain when they are sent to the Internet. When new messages, or replies to messages that originated from the rewritten domain, arrive at the computer that has the Edge Transport server role installed, Exchange 2010 rewrites the recipient address in the header of the inbound messages that have the internal domain contoso.com and delivers the message to the recipient.
This example creates an address rewrite entry that rewrites a single domain.
New-AddressRewriteEntry -Name "Contoso to Fabrikam" -InternalAddress contoso.com -ExternalAddress fabrikam.com
For detailed syntax and parameter information, see New-AddressRewriteEntry.
Use the Shell to rewrite multiple subdomains
You need to be assigned permissions before you can perform this procedure. To see what permissions you need, see the "Address Rewriting agent" entry in the Transport Permissions topic.
Note
You can't use the EMC to rewrite a multiple subdomains.
You can rewrite the headers of e-mail messages sent from mailboxes located in one of multiple internal subdomains. When you rewrite multiple subdomains, you have the following options:
Rewrite e-mail messages from all subdomains This option enables you to rewrite all subdomains to a single external domain without exception. All e-mail messages from all subdomains will be rewritten.
Rewrite e-mail messages from specific subdomains You may have to rewrite e-mail messages from specific subdomains, but don't want to affect other subdomains. This option is especially convenient when you have many subdomains but only want to rewrite addresses for a few of them. In Exchange 2010, you can configure address rewriting for only those specific subdomains without creating many exceptions.
Rewrite e-mail messages from all subdomains with exceptions You may have to configure address rewriting for many subdomains, but may also have to prevent some subdomains from being rewritten. Instead of creating individual address rewrite entries for each subdomain, you can create an address rewrite entry that encompasses all subdomains, and then specify exceptions for those subdomains that you don't want to rewrite.
Before you configure address rewriting for multiple internal subdomains, you must first prepare your subdomains.
The following examples show how you can use the New-AddressRewriteEntry cmdlet to configure address rewriting for multiple subdomains.
This example creates an address rewrite entry that rewrites all e-mail messages sent from multiple subdomains and the parent domain.
New-AddressRewriteEntry -Name "Rewrite all contoso.com subdomains" -InternalAddress *.contoso.com -ExternalAddress contoso.com -OutboundOnly $True
This example creates an address rewrite entry that rewrites all e-mail messages sent from specific subdomains.
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
This example creates an address rewrite entry that rewrites all e-mail messages sent from multiple subdomains and the parent domain, except subdomains that you specify.
New-AddressRewriteEntry -name "Rewrite all contoso.com subdomains 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.
© 2010 Microsoft Corporation. All rights reserved.