Delen via


How to Modify a Transport Rule

Microsoft Exchange Server 2007 will reach end of support on April 11, 2017. To stay supported, you will need to upgrade. For more information, see Resources to help you upgrade your Office 2007 servers and clients.

 

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

This topic explains how to use the Exchange Management Console or the Exchange Management Shell to modify an existing transport rule that is configured on a computer that has the Microsoft Exchange Server 2007 Hub Transport server role or the Edge Transport server role installed.

For more information about the Transport Rules agents, see Overview of Transport Rules.

Before You Begin

To perform the following procedures, the account you use must be delegated the following:

  • Exchange Organization Administrator role

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.

For more information about permissions, delegating roles, and the rights that are required to administer Exchange 2007, see Permission Considerations.

To perform the procedures to modify transport rules, you must be familiar with how to create transport rules by using the Exchange Management Console and the Exchange Management Shell. For an in-depth discussion of how to create a transport rule, see How to Create a New Transport Rule.

For more information about how transport rules are applied on Hub Transport servers and Edge Transport servers, see Understanding How Transport Rules Are Applied in an Exchange 2007 Organization.

Warning

This topic describes how to modify existing transport rules. Before you modify existing transport rules in your production environment, use a test environment to learn how to modify existing transport rules and test them thoroughly. The following procedures are not intended to be run in a production environment without modification to support your organization.

Important

For transport rules to be applied to e-mail messages, a route must exist that enables the message to enter and leave a server that applies transport rules. Also, the message must not be subject to an administrator-configured transport restriction that prevents delivery of the message. If a transport restriction prevents delivery of a message, the Transport Rules agent cannot act on that message, and no Transport Rules agent events are logged.

Using the Exchange Management Console to Modify an Existing Transport Rule

The following procedures show you how to open the Transport Rule wizard and modify an existing transport rule in the Exchange Management Console on a Hub Transport server or an Edge Transport server. Select the procedure for the server role that you are administering.

To use the Exchange Management Console to modify an existing transport rule on a Hub Transport server

  1. Open the Exchange Management Console on the Hub Transport server.

  2. In the console tree, click Organization Configuration, and then click Hub Transport.

  3. In the result pane, on the Transport Rules tab, right-click the rule that you want to modify, and then click Edit Rule.

  4. Click Next to navigate through the Transport Rule wizard to the pages that have the transport rule properties that you want to modify. Modify the properties.

  5. When you complete your modifications, click Update, and then click Finish.

To use the Exchange Management Console to modify an existing transport rule on an Edge Transport server

  1. Open the Exchange Management Console on the Edge Transport server that contains the transport rule that you want to modify.

  2. In the console tree, click Edge Transport.

  3. In the result pane, on the Transport Rules tab, right-click the rule that you want to modify, and then click Edit Rule.

  4. Click Next to navigate through the Transport Rule wizard to the pages that have the transport rule properties that you want to modify. Modify the properties.

  5. When you complete your modifications, click Update, and then click Finish.

Using the Exchange Management Shell to Modify a Transport Rule

The conditions, exceptions, and actions that exist on a transport rule are stored in arrays, as are the values that are stored in each condition, exception, or action. This grouping of conditions, exceptions, actions, and their related values in Microsoft Exchange 2007 provides a very flexible architecture for applying your organization's policies.

Important

If you configure a transport rule condition or exception that uses a distribution group, you must specify a universal security group. This is required because transport rules are replicated to all Hub Transport servers in an organization and may include Hub Transport servers in remote Active Directory domains. These Active Directory domains may not have access to distribution groups that were not created as universal distribution groups.

To work with transport rules in the Exchange Management Shell, you must be familiar with the following concepts:

Arrays and Single Values

Arrays are used in most aspects of the configuration of a transport rule's conditions, exceptions, and actions. At the highest level, arrays provide a grouping for each condition, exception, and action. For example, the conditions that are configured on a transport rule are part of an array called Conditions. In the Conditions array, each condition is stored in an array element and each array element is assigned an array element number. If you access the Conditions array by using an array element number, you can retrieve the condition that is stored in that element. The same is true for the Exceptions array and the Actions array.

Most conditions and exceptions, and some actions, also use arrays to store values. Using arrays with conditions, exceptions and actions enables Exchange 2007 to store multiple values that the Transport Rules agents can use to determine whether a rule should be triggered against a particular message and what action the transport rule should apply to that message. The structure described earlier applies. Each condition, exception, and action value is stored in an array element that you can access by using the array element number.

Some conditions, exceptions, and most actions only support single values and do not use arrays. In these cases, you do not have to use or construct arrays to configure a value. For more information about which conditions, exceptions, and actions support arrays, single values, or no values, see Transport Rule Predicates and Transport Rule Actions.

Modifying Conditions, Exceptions, or Actions on an Existing Transport Rule

The procedures used to modify the conditions, exceptions, and actions that exist on a transport rule are very similar. In this topic, we explain how to modify conditions, but you can apply this information to modifying both exceptions and actions. For more information about how to modify conditions, exceptions, or actions, see the topics that are referred to later in this section.

Note

To modify the values that are configured on conditions or exceptions, see "Modifying the Values of an Existing Condition or Exception on a Transport Rule" later in this topic.
To modify the values that are configured on transport rule actions, see "Modifying the Values of an Existing Action on a Transport Rule" later in this topic.

When you modify a condition on a transport rule, you must access the arrays that hold the conditions and their values. If you want to add or remove conditions from a transport rule, you must split the elements of the Condition array into separate variables to make modifications.

If you want to remove a condition from an array, you must re-create the condition array, because there is currently no simple way to remove an element from an array. When you split the array elements into separate variables, you can re-create the array by assigning only the variables that contain the conditions that you want to keep when you run the Set-TransportRule command. For example, you have the following three conditions:

  • Condition1

  • Condition2

  • Condition3

You no longer require Condition2. To remove Condition2, you assign Condition1 and Condition3 to the variables $Variable1 and $Variable3. Then you add the two variables to the transport rule with the command Set-TransportRule "Example" -Condition @($Variable1, $Variable3). This command replaces the previously configured condition array with the new one that you specified.

You must also re-create the condition array when you add a new condition. Although you can add a new condition to an existing Conditions array, the new condition is not inserted into the existing condition array in the correct order. To add the new condition in the correct order in the condition array, you must split the existing conditions into separate variables, create the new conditions, and then manually order the pre-existing and new variables when you run the Set-TransportRule command. For example, you have the following three conditions:

  • ExCondition1

  • ExCondition2

  • ExCondition3

You want to add a new condition that you assigned to the variable $NewCondition. To add the new condition, you first assign the existing conditions to the variables $ExVariable1, $ExVariable2 and $ExVariable3. Then you determine the correct order of the existing conditions and the new condition. You then assign the existing and new conditions to the existing transport rule by using the command Set-TransportRule "Example" @($ExVariable1, $ExVariable2, $NewCondition, $ExVariable3). This command replaces the previously configured condition array with the one that you specified.

For the detailed steps that you must perform to add or remove conditions and exceptions that exist on a transport rule, see "Modifying Conditions or Exceptions on a Transport Rule" in How to Modify Transport Rule Conditions and Exceptions in the Exchange Management Shell.

For the detailed steps that you must perform to add or remove actions that exist on a transport rule, see "Modifying the Actions on a Transport Rule" in How to Modify Transport Rule Actions in the Exchange Management Shell.

Modifying the Values of an Existing Condition, Exception, or Action on a Transport Rule

The values that are configured on most conditions are also stored in arrays. However, the procedures used to add and remove values from conditions are slightly different from the procedures used to modify conditions.

When you want to remove values that are configured on a condition, you must re-create the value array of the condition, because there is currently no simple way to remove an element from an array.

When you remove values that are configured on a condition, you must first note all values on that condition and then re-apply them to the condition, omitting the values that you no longer require. For example, you configured Value1, Value2, and Value3 on a SubjectContains condition, but you no longer require Value2. The condition is assigned to the $Condition variable. To remove Value2, you must re-create the value array of the condition by using the command $Condition.Words = @("Value1", "Value3").

To add a value to an existing condition, however, you can add the value directly to the condition. For example, to add Value4 to the SubjectContains condition described earlier in this section, use the command $Condition.Words += @("Value4").

Note

These examples assume that the conditions that are being modified accept multiple values. For conditions that accept only one value, the same procedures can be used. For single-value conditions, do not use arrays.

To modify exceptions on a transport rule, you can use the procedures for modifying conditions. However, you must change the word Condition to the word Exception in the procedures.

For the detailed steps that you must perform to add or remove values that are configured on conditions that exist on a transport rule, see "Modifying the Values of an Existing Condition on a Transport Rule" in How to Modify Transport Rule Conditions and Exceptions in the Exchange Management Shell.

To modify actions on a transport rule, you can use similar procedures for modifying conditions. However, you must change the word Condition to the word Action in the procedures, and you must use actions and action properties in place of predicates and predicate properties.

For the detailed steps that you must perform to add or remove values that are configured on actions that exist on a transport rule, see "Modifying the Value of an Existing Action on a Transport Rule" in How to Modify Transport Rule Actions in the Exchange Management Shell.

For More Information

For more information about transport rules, see the following topics: