Logo
programming4us
programming4us
programming4us
programming4us
Windows XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
 
Windows Server

Exchange Server 2010 : Managing Transport Rules (part 2) - Managing Transport Rules

5/7/2011 10:15:13 AM

2. Managing Transport Rules

You can use either the Exchange Management Console (EMC) or the EMS to create, modify, view, enable, disable, remove, export, or import a transport rule on both Hub Transport and Edge Transport servers.

2.1. Creating a Transport Rule

You can create transport rules on Hub Transport or Edge Transport servers. Both server roles have many common predicates and actions, but some predicates and actions are exclusive to each Transport server role. Earlier in this lesson, you saw examples of the use of EMS commands based on the New-TransportRule cmdlet to create transport rules. You can also use the EMC to create a transport rule. The high-level procedure to do this on a Hub Transport server is as follows:

  1. In the EMC Console pane, expand Organization Configuration and click Hub Transport.

  2. Click the Transport Rules tab on the Result pane.

  3. Click New Transport Rule on the Actions pane. This starts the New Transport Rule Wizard.

  4. Complete the following fields on the Introduction page of the wizard:

    • Name Provide a name for the transport rule.

    • Comment Optionally, use this field to describe what the rule does.

    • Enable Rule New rules are enabled by default. If you want to create the rule in a disabled state, clear this check box.

  5. If you want the rule to be applied to all email messages, do not select any conditions on the Conditions page. Otherwise, complete the following fields:

    • In the Step 1. Select Condition(s) box, select all the conditions that you want to apply to the rule.

    • If you have selected conditions in the Select Conditions box, click each blue underlined word in turn in the Step 2. Edit The Rule Description By Clicking An Underlined Value box. When you click a blue underlined word, a new window opens to prompt you for the values to apply to the condition. Select the values that you want to apply or type the values manually and click Add. Repeat this process until you have entered all the values and then click OK.

  6. On the Actions page, shown in Figure 4, select all the actions that you want to apply to this rule in the Step 1. Select The Actions box.

  7. Click each blue underlined word in turn in the Step 2. Edit The Rule Description By Clicking An Underlined Value box. Specify actions in the same way that you specified conditions in the previous step.

  8. If you do not want to define any exceptions, do not make any selections on the Exceptions page. Otherwise, complete the following fields:

    • Select all the exceptions that you want to apply to the rule in the Step 1. Select The Exceptions If Necessary box.

    • If you select exceptions, click each blue underlined word in turn in the Step 2. Edit The Rule Description By Clicking An Underlined Value box. Specify exceptions in the same way that you specified conditions and actions in previous steps.

    Figure 4. The Actions page of the New Transport Rule Wizard


  9. Review the Configuration Summary on the Create Rule page. If you are satisfied with the configuration of the rule, click New.

  10. A status of Completed on the Completion page indicates that the wizard completed the task successfully. In this case, click Finish to close the wizard. Otherwise, review the summary for an explanation of the failure and click Back to make any required configuration changes.


2.2. Modifying a Transport Rule

You can use the EMS or the EMC to modify an existing transport rule. To use the EMC, you access the Transport Rules tab, as previously described in the procedure, to create a transport rule. You then select the transport rule you want to modify and click Edit Rule in the Actions pane. The Introduction, Conditions, Actions, and Exceptions pages of the Edit Transport Rule Wizard are the same as those in the New Transport Rule Wizard, and you can edit the settings on these pages. You can review the changes displayed in the Configuration Summary on the Update Rule page and click Update if you are satisfied with them. Otherwise, click Back to make a revision. Finally, click Finish on the Completion page.

You can use an EMS command based on the Set-TransportRule cmdlet to modify a transport rule. The following command modifies the transport rule TransportRuleExample so that messages sent to Mark Harrington are sent to both Kim Akers and Don Hall, unless they come from DonalMace@Contoso.com:

Set-TransportRule -Identity TransportRuleExample -AddToRecipients "Kim Akers","Don Hall"
-ExceptIfFrom DonalMace@Contoso.com

2.3. Viewing Transport Rules

You may want to list all the transport rules stored in Active Directory in an Exchange Server 2010 organization or in AD LDS on an Edge Transport server. You may also want to view the properties of a specific transport rule. You can see a list of transport rules that apply to a Hub Transport server (and to all other Hub Transport servers in the Exchange organization) by expanding Organization Configuration and clicking Hub Transport on the EMC pane. You then click the Transport Rules tab in the Result pane, and a list of the transport rules appears on that tab. On an Edge Transport server, the procedure is similar except that you click Edge Transport on the Console pane, and the list on the Transport Rules tab applies only to the current server.

If you want to view the properties of a transport rule, you can click on the rule on the Transport Rules tab and then click Edit Rule on the Actions pane. You can step through the pages of the Edit Transport Rule Wizard without making any changes and hence view the transport rule configuration.

You can use the EMS to view a summary list of all transport rules configured on all Hub Transport servers or an Edge Transport server by entering the following command:

Get-TransportRule

Figure 5 shows the output of this command on Hub Transport server VAN-EX1. You might have a different list on the same server on your test network. The list of transport rules on a Hub Transport server in a production network is likely to be considerably longer.

Figure 5. Listing transport rules


You can obtain a list of the properties of a specific transport rule by entering an EMS command similar to the following:

Get-TransportRule TransportRuleExample | FL

Figure 6 shows some of the output of this command.

Figure 6. Listing the properties of a transport rule



Note:

You use the New-TransportRule EMS cmdlet to create a new transport rule. You use the Set-TransportRule EMS cmdlet to modify a transport rule. This includes adding conditions, exceptions, or actions to the rule. You use the Get-TransportRule EMS cmdlet to display the properties of an existing rule. The Get-TransportRuleAction EMS cmdlet allows you to view the actions that the transport rule performs.


2.4. Enabling or Disabling and Removing a Transport Rule

The transport rule agent must be enabled before you can apply transport rules to email messages that pass through a Hub Transport server, and the edge rule agent must be enabled before you can apply transport rules to messages that pass through an Edge Transport server. These agents are enabled by default, but if an agent becomes disabled, all transport rules are disabled. This is an unusual event possibly caused by a software fault, but if you need to, you can use the following EMS command on either a Hub Transport or an Edge Transport server to check the status of the appropriate transport agent:

Get-TransportAgent

Figure 7 shows the output of this command.

Figure 7. Checking the status of the transport agent


More typically, you may want to temporarily stop the execution of a single transport rule. To use the EMC to disable a transport rule, you list the transport rules on the Transport Rules tab, as described in the previous section, Section 2.3; right-click the transport rule you want to disable; and then click Disable Rule. You need to click Yes to confirm this action. If a rule is already disabled and you want to enable it, you right-click it and click Enable Rule. Note that disabling a rule on a Hub Transport server disables that rule for all Hub Transport servers in the Exchange organization. Disabling a rule on an Edge Transport server disables that rule only on that particular server.

If a transport rule is no longer required, the procedure to remove it is the same as the procedure to disable it, except that you click Remove instead of Disable Rule. As with disabling a rule, you need to click Yes to confirm the action. Take care that although you can enable a disabled rule, you cannot retrieve a rule that you remove, and you need to re-create it (or restore from backup) if you removed it in error.

You can use the EMS to disable and enable and to remove a transport rule. For example, the following EMS command disables the transport rule TransportRuleExample:

Disable-TransportRule TransportRuleExample

Note that this command requires confirmation unless you set the Confirm switch to suppress this requirement. The following command enables the transport rule that was previously disabled:

Enable-TransportRule TransportRuleExample

You can use a command based on the Remove-TransportRule EMS cmdlet to remove a transport rule. However, because this action is irreversible, it is a good idea to use the WhatIf switch to determine the results of removing a rule before you do so. You would enter a command similar to the following:

Remove-TransportRule TransportRuleExample -WhatIf

If you are sure it is what you want to do, you could then use a command similar to the following to remove the transport rule:

Remove-TransportRule TransportRuleExample

You need to confirm this command unless you have configured the Confirm switch so that confirmation is not required.


2.5. Exporting and Importing Transport Rules

If you want to duplicate the same transport rule on more than one Edge Transport server, you can export it from the server on which you created it and import it to other Edge Transport servers. Note that if you want to replicate the entire Exchange configuration on all Edge Transport servers, you should instead clone the Edge Transport servers.

Another situation in which you might want to export and import transport rules is if you are configuring coexistence while updating an Exchange Server 2007 organization to Exchange Server 2010. Exchange Server 2007 stores transport rules in a container that is different than that used by Exchange Server 2010. Any existing transport rules that exist in the Exchange 2007 container need to be converted and stored in the Exchange 2010 container so that the Exchange organization has the same set of transport rules for both Exchange Server versions and the same messaging policies apply. You export Exchange Server 2007 rules so that you can import them into Exchange Server 2010 by entering an EMS command based on the Export-TransportRuleCollection cmdlet and the ExportLegacyRules parameter. This command runs on an Exchange Server 2010 Hub Transport server.


Note:

You can export Exchange Server 2007 transport rules and then import them into Exchange Server 2010. However, you cannot export Exchange Server 2010 transport rules and import them into Exchange Server 2007.


You can use the EMS but not the EMC to export and import transport rules. The following two EMS commands export transport rules on an Exchange Server 2010 server running the Hub Transport or Edge Transport server role by exporting transport rule data to the variable $transportfile and then writing it to the Exchange2010TransportRules.xml file in the C:\MyDocs folder:

$transportfile = Export-TransportRuleCollection
Set-Content -Path "C:\MyDocs\Exchange2010TransportRules.xml" -Value $transportfile
.FileData -Encoding Byte


The following two EMS commands, entered on an Exchange Server 2010 Hub Transport server, export legacy transport rules created in Exchange 2007:

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



Note:

TAKE CARE WHEN IMPORTING TRANSPORT RULES

Importing a transport rule collection from an XML file removes or overwrites preexisting transport rules defined for the transport rules agent. Ensure that you have a backup of your current transport rule collection before you import and overwrite transport rules.


You export transport rules to an XML file and define the path of that file in the EMS command. You can then import transport rules from that file. The following EMS commands import transport rules from the ExportedRules.xml file:

[Byte[]]$transportdata = Get-Content -Path "C:\MyDocs\ExportedRules.xml" -Encoding Byte
-ReadCount 0
Import-TransportRuleCollection -FileData $transportdata

Other -----------------
- SharePoint 2010 PerformancePoint Services : Securing a PerformancePoint Installation - Create SPNs for the Farm and Data Sources
- SharePoint 2010 PerformancePoint Services : Securing a PerformancePoint Installation - Configuring Per-User Authentication with Kerberos
- SharePoint 2010 PerformancePoint Services : Securing a PerformancePoint Installation - Securing a Deployment with TLS
- BizTalk 2010 Recipes : Deployment - Enlisting and Starting Send Ports
- BizTalk 2010 Recipes : Deployment - Deploying a BizTalk Solution from Visual Studio
- BizTalk 2010 Recipes : Deployment - Manually Deploying Updates
- Exchange Server 2010 : Configuring Federated Sharing (part 2) - Assigning the Federated Sharing Role
- Exchange Server 2010 : Configuring Federated Sharing (part 1) - Implementing Federated Sharing
- Exchange Server 2010 : Role Based Access Control
- BizTalk 2010 Recipes : Deployment - Importing Applications
 
 
Video tutorials
- How To Install Windows 8 On VMware Workstation 9

- How To Install Windows 8

- How To Install Windows Server 2012

- How To Disable Windows 8 Metro UI

- How To Change Account Picture In Windows 8

- How To Unlock Administrator Account in Windows 8

- How To Restart, Log Off And Shutdown Windows 8

- How To Login To Skype Using A Microsoft Account

- How To Enable Aero Glass Effect In Windows 8

- How To Disable Windows Update in Windows 8

- How To Disable Windows 8 Metro UI

- How To Add Widgets To Windows 8 Lock Screen
programming4us programming4us
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 windows Phone 7 windows Phone 8
programming4us programming4us
 
Popular keywords
HOW TO Swimlane in Visio Visio sort key Pen and Touch Creating groups in Windows Server Raid in Windows Server Exchange 2010 maintenance Exchange server mail enabled groups Debugging Tools Collaborating
programming4us programming4us
 
programming4us
Women
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone