Applies to: Exchange Server 2010 SP3, Exchange Server 2010 SP2

Topic Last Modified: 2012-11-19

Use the Export-TransportRuleCollection cmdlet to export a transport rule collection used by the Transport Rules agent on a computer running Microsoft Exchange Server 2010 that has the Hub Transport server role or the Edge Transport server role installed.


Export-TransportRuleCollection [-Identity <RuleIdParameter>] [-Confirm [<SwitchParameter>]] [-DomainController <Fqdn>] [-ExportLegacyRules <SwitchParameter>] [-Organization <OrganizationIdParameter>] [-WhatIf [<SwitchParameter>]]

Detailed Description

The Export-TransportRuleCollection cmdlet can be used to export the transport rule collection on an Exchange 2010 Hub Transport server, export legacy transport rules created in Exchange Server 2007 for import to Exchange 2010, or export transport rules on an Exchange 2010 Edge Transport server.

For information about how to import a transport rule collection from an XML file, see Import-TransportRuleCollection.

For information about the Transport Rules agent, see Overview of Transport Rules.

In Exchange 2010, you must export the rules collection to a variable and then use the Set-Content cmdlet to write the data to an XML file. For more information, see Set-Content.

You need to be assigned permissions before you can run this cmdlet. Although all parameters for this cmdlet are listed in this topic, you may not have access to some parameters if they're not included in the permissions assigned to you. To see what permissions you need, see the "Transport rules" entry in the Messaging Policy and Compliance Permissions topic.


Parameter Required Type Description




The Confirm switch causes the command to pause processing and requires you to acknowledge what the command will do before processing continues. You don't have to specify a value with the Confirm switch.




The DomainController parameter specifies the fully qualified domain name (FQDN) of the domain controller that retrieves data from Active Directory. The DomainController parameter isn't supported on the Edge Transport server role. The Edge Transport server role reads only from the Active Directory Lightweight Directory Services (AD LDS) instance.




The ExportLegacyRules switch is used to export legacy transport rules.




The Identity parameter specifies the name or GUID of a transport rule to be exported.




This parameter is available for multi-tenant deployments. It isn't available for on-premises deployments. For more information about multi-tenant deployments, see Multi-Tenant Support.

The Organization parameter specifies the organization in which you'll perform this action. This parameter doesn't accept wildcard characters, and you must use the exact name of the organization.




The WhatIf switch instructs the command to simulate the actions that it would take on the object. By using the WhatIf switch, you can view what changes would occur without having to apply any of those changes. You don't have to specify a value with the WhatIf switch.

Input Types

To see the input types that this cmdlet accepts, see Cmdlet Input and Output Types. If the Input Type field for a cmdlet is blank, the cmdlet doesn’t accept input data.

Return Types

To see the return types, which are also known as output types, that this cmdlet accepts, see Cmdlet Input and Output Types. If the Output Type field is blank, the cmdlet doesn’t return data.



This example exports transport rules on an Exchange 2010 Hub Transport or Edge Transport server. Rule data is exported to the variable $file, and then written to the XML file Rules.xml in the C:\MyDocs folder.

Copy Code
$file = Export-TransportRuleCollection
Set-Content -Path "C:\MyDocs\Rules.xml" -Value $file.FileData -Encoding Byte


This example exports legacy transport rules created in Exchange 2007 using the ExportLegacyRules switch. The cmdlet should be run from an Exchange 2010 Hub Transport server. The exported rules collection can then be imported to Exchange 2010 using the Import-TransportRuleCollection cmdlet.

Copy Code
$file = Export-TransportRuleCollection -ExportLegacyRules
Set-Content -Path "C:\MyDocs\LegacyRules.xml" -Value $file.FileData -Encoding Byte