Export (0) Print
Expand All

Export-TransportRuleCollection

Applies to: Exchange Server 2010

Topic Last Modified: 2011-03-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>]]

Parameter Required Type Description

Confirm

Optional

System.Management.Automation.SwitchParameter

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.

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

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.

ExportLegacyRules

Optional

System.Management.Automation.SwitchParameter

The ExportLegacyRules switch is used to export legacy transport rules.

Identity

Optional

Microsoft.Exchange.MessagingPolicies.Rules.Tasks.RuleIdParameter

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

Organization

Optional

Microsoft.Exchange.Configuration.Tasks.OrganizationIdParameter

The Organization parameter is reserved for internal Microsoft use.

WhatIf

Optional

System.Management.Automation.SwitchParameter

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.

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.

Bb124410.important(en-us,EXCHG.140).gifImportant:
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.

Error Description

 

 

Exceptions Description

 

 

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.

$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.

$file = Export-TransportRuleCollection -ExportLegacyRules
Set-Content -Path "C:\MyDocs\LegacyRules.xml" -Value $file.FileData -Encoding Byte
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft