Quantcast
Channel: You Had Me At EHLO…
Viewing all 197 articles
Browse latest View live

Everything you wanted to know about read receipts and delivery reports but were (understandably) afraid to ask

$
0
0

A question that comes up often enough to merit a post is: "How does one block read receipts from leaving or entering my org?"

Good question. I'm glad you asked!

And to answer that we need to go into the way back machine to Exchange 2003.

In Exchange 2003 we used the IIS SMTP engine. As you know all the relevant settings were kept in the IIS metabase (taken from AD during the DS2MB 1 way process or natively there) so when it was requested that the ability to block read receipts be put into the product we obliged with a hotfix that allowed the creation of a key in the metabase to block these (after it was discovered that checking off "Do not send delivery reports" on the remote domain object did not accomplish this. More on that later.)

You can read about this in all its glory here.

While you are reading that you may notice the first sentence which mentions how editing the Remote Domain "Do not send delivery reports" will NOT block read receipts from entering/leaving your org (told you we'd come back to that).

Without getting too much into RFCs, a read receipt is not a delivery report. A delivery report is defined in RFC 1891. The mime content type of a delivery report is a multipart/report; report-type=delivery-status.

Actual shot of a delivery report below:

A read receipt is defined in RFC 2298 and has a mime content type of multipart/report; report-type=disposition-notification.

Actual read receipt found in the wild below:

A further thing to note is that delivery reports originate from the system administrator or postmaster or Microsoft Exchange Recipient account (depending on which version of Exchange we are talking about) while Read Receipts come from the recipient that has requested a receipt.

Still with me? Ok so if we circle back to the original Exchange 2003 kb it should be noted that those instructions only prevent INCOMING read receipts from entering your org. They do NOT stop internal users from sending read receipts to each other or from requesting read receipts of external users.

What adding that key to the metabase actually accomplishes is stripping of the Disposition-Notification-To mime header from incoming read receipt requests.

Read that again: read receipt REQUESTS.

Going back to the RFCs (I'll be quick I promise) there is a difference between the actual read receipt itself and the read receipt request (same goes for delivery reports and the initial delivery report request).

A read receipt request contains a Disposition-Notification-To header like the one below:

This is an important distinction as it is the read receipt request that causes the receiver to generate a Read Receipt.

This is what causes the receiver of the request to see this pop-up in Outlook:

If we strip that header the receiver is never prompted for a Read Receipt and thus never generates one.

Doing this for incoming messages is easy in Exchange 2003 since it is just a mime header we can strip.

Outgoing is not possible as the header is now a tnef MAPI property and part of the message structure.

Stopping outgoing read receipt requests requires a much greater code change investment and ultimately was never possible in exchange 2003 (for the curious and for completeness sake - a delivery report also has a corresponding delivery report request which is identified by the NOTIFY=SUCESS,FAILURE,DELAY parameters after a RCPT TO:. However unchecking "Allow Delivery Reports" on the remote domain object effectively blocks all Delivery Reports from coming out.)

Enter Exchange 2007. Yippee!

With Exchange 2007 we now have transport rules so we can totally block Read Receipts from leaving and entering, right?

Well, sort of.

For incoming read receipt requests we can create a transport rule to strip the Disposition-Notification-To header. Such a rule might look like this:

For outgoing Read Receipt requests we fall into a new twist on the Exchange 2003 issue.

Certain properties of an outgoing internally originated message are kept in a special x-header called X-ExtendedProps and you guessed it, Read Receipt request information is one of them.

This is a "pesudo-base64" encoded header that Exchange hub transport servers stamp on internal messages and which gets stripped out later by header firewall.

You can see this header by suspending the submission queue on a hub and export one of the suspended messages in there.

You will see something like this:

I'd like to pause here for a brief break and say that you will not see this header if you do a pipeline trace. It will only be visible if you export the message from the queue. The reason for this is that due to certain issues with custom transport agents in Exchange 2007 SP 1 we moved the content conversion stage further down the transport pipeline in Categorizer so a pipeline trace will only show you the state of a message PRE-conversion.

Ok, break over.

Since we have all the Read Receipt request info in this X-ExtendedProps header having a rule strip the Disposition-Notification-To header will have no effect. And transport rules cannot act on the system X-header (and even if they could very bad things may happen if you try to strip them. Just sayin').

Really the best way to strip outgoing Read Receipt requests is to stand up an Edge Transport server and have the identical rule above as an Edge rule. As stated earlier, once the message leaves the org Header Firewall will strip the X-header and replace it (in our case) with the standard RFC Disposition-Notification-TO.

This will prevent external recipients from receiving the dreaded pop-up (shown here again for effect) which will generate a incoming read receipt:

A second option is to deploy the Office ADM template in a GPO to remove the ability of users to send out read receipt requests. (You will still need the hub transport rule to block incoming Read Receipt requests).

Now we can move on to Exchange 2010 (can I hear a double yippee?).

With Exchange 2010 we have many new additions to transport rules which would make the subject of a great blog post on its own. The one new addition we are concerned with here is the ability to act on messages based on class. Specifically here we are concerned with the read receipt class. With Exchange 2010 we can craft a transport rule to drop messages based on the read receipt class as shown below:

Now the above Exchange 2010 rule should solve our issue! This is great and wonderful! Finally no read receipt requests leaving OR entering my org!

Well... not so fast.

You see, what the above rule does is block the actual read receipt (the multipart/report; report-type=disposition-notification content type. Check the beginning of this blog post if you forgot. Its ok I'll wait).

This rule will not block the original read receipt request (shown here again because I believe in learning through repetition):

So we are back to either:

  1. Create an incoming rule on your hub and an outgoing rule on your Edge to remove the header.
  2. Set an incoming rule on your hub and use the Outlook ADM file to create a GPO to remove the option to request Read Receipts

So at the end of all this we've learned that while finally in Exchange 2010 we can block actual read receipts with ease, it still takes a bit of doing to block the read receipt request and be rid of all types of RRs entirely. But it is possible.

Tom Kern


Potential for database corruption as a result of installing Exchange 2007 SP3 RU3

$
0
0

Update 3/31/2011: The updated Exchange 2007 SP3 RU3 has been released. See Announcing the Re-release of Exchange 2007 Service Pack 3 Update Rollup 3 (V2).
3/30/2011: We posted a status update for this issue. See Exchange 2007/2010 Rollup 3 Status Update.

Over the weekend, the Exchange Product Group was made aware of an issue which may lead to database corruption if you are running Exchange 2007 Service Pack 3 with Update Rollup 3 (Exchange 2007 SP3 RU3). Specifically, the issue was introduced in Exchange 2007 SP3 RU3 by a change in how the database is grown during transaction log replay when new data is written to the database file and there are no available free pages to be consumed.

This issue is of specific concern in two scenarios: 1) when transaction log replay is performed by the Replication Service as part of ensuring the passive database copy is up-to-date and/or 2) when a database is not cleanly shut down and recovery occurs.

While only a small number of customers have been affected to date, we believe the risk is significant enough that we are recommending all customers to uninstall Exchange 2007 SP3 RU3 on all Mailbox Servers and Transport servers. Uninstalling the rollup will revert the system back to the previously installed version. We have also removed the Exchange 2007 SP3 RU3 download from the Microsoft Download Center and from Microsoft Update until we are able to produce a new version of the rollup.

We are actively working this issue and based on test results plan to release an updated version of Exchange 2007 SP3 RU3 to the Download Center later this week. In addition, we are conducting an internal review of our processes to determine how to prevent issues such as this in the future.

When this issue occurs, the following similar events are logged in the Application Event log of the Mailbox server. Regardless of whether you see these types of events, you should review the recovery instructions and begin that process. If you are uncomfortable performing any of these steps please contact Microsoft Support for assistance.

  • Event ID: 454
    Event Type: Error
    Event Source: ESE
    Event Category: Logging/Recovery
    Description: Microsoft.Exchange.Cluster.ReplayService (12716) Recovery E20 SG1\DB1: Database recovery/restore failed with unexpected error -4001.
  • Event ID: 2095
    Event Type: Error
    Event Source: MSExchangeRepl
    Event Category: Service
    Description: Log file D:\logs\SG1\E200006AFAE.log in SG1\DB1 could not be replayed. Re-seeding the passive node is now required. Use the Update-StorageGroupCopy cmdlet in the Exchange Management Shell to perform a re-seed operation
  • Event ID: 2097
    Event Type: Error
    Event Source: MSExchangeRepl
    Event Category: Service
    Description: The Microsoft Exchange Replication Service encountered an unexpected Extensible Storage Engine (ESE) exception in storage group 'SG1\DB1'. The ESE exception is a read was issued to a location beyond EOF (writes will expand the file) (-4001) ().

In addition, in environments utilizing Continuous Replication, comparison of the database file between the active and passive nodes will indicate that the database file has decreased in size.

Regardless of whether you are experiencing this issue, we strongly recommend taking the below actions to ensure that you do not experience any data loss or outage event associated with this issue.

For example:

  • If you have deployed your Mailbox servers utilizing Cluster Continuous Replication (CCR), failure of the active copies may affect your service SLA as you may have no viable passive copies to activate. Hardware failures may result in you not having a means to recover up to the point of failure and thus may experience data loss.
  • If you have deployed your Mailbox servers utilizing Single Copy Clusters (SCC), switchovers or failovers may result in this issue as there is only one copy of the database and recovery is performed during switchovers and failovers.

For environments leveraging CCR and/or Standby Continuous Replication (SCR)

If you note the listed events in your environment the following steps must be taken in order to restore your high-availability configuration:

  1. Rollback the CCR Mailbox server hosting the passive database copies and any SCR target Mailbox servers to the previously installed version (e.g., Exchange 2007 SP3 RU2) by uninstalling RU3.
  2. Re-seed all affected database copies on the CCR Mailbox server and any SCR target Mailbox servers hosting the passive database copies.
  3. Verify the database copy status is healthy for all passive copies.
  4. Perform a switchover and rollback the remaining CCR Mailbox server to the previously installed version (e.g., Exchange 2007 SP3 RU2).

If you are not seeing these events in your continuous replication enabled environment, we recommend the following steps:

  1. Rollback the CCR Mailbox server hosting the passive database copies and any SCR target Mailbox servers to the previously installed version (e.g., Exchange 2007 SP3 RU2) by uninstalling RU3.
  2. Perform a switchover and rollback the remaining CCR Mailbox server to the previously installed version (e.g., Exchange 2007 SP3 RU2).

For environments leveraging Single Copy Clusters (SCC)

  1. Rollback passive nodes within the SCC environment to the previously installed version (e.g., Exchange 2007 SP3 RU2) by uninstalling RU3.
  2. Perform a switchover and rollback the remaining SCC Mailbox server nodes to the previously installed version (e.g., Exchange 2007 SP3 RU2).
  3. If you have any databases that will not mount as a result of the above issue, you can restore the damaged databases leveraging a last known good backup.

For environments leveraging standalone Mailbox (or Public Folder) servers

  1. Rollback the standalone Mailbox servers to the previously installed version (e.g., Exchange 2007 SP3 RU2) by uninstalling RU3.
  2. If you have any databases that will not mount as a result of the above issue, you can restore the damaged databases leveraging a last known good backup.

For Hub Transport and Edge Transport servers

  1. Rollback the standalone transport servers to the previously installed version (e.g., Exchange 2007 SP3 RU2) by uninstalling RU3.
  2. If any transport servers have mail.que databases which currently do not mount as a result of the above issue, you can recover them by following the steps in Working with the Queue Database on Transport Servers.

Kevin Allison
GM Exchange Customer Experience

Store Driver Fault Isolation Improvements in Exchange 2010 SP1

$
0
0

Background

The Exchange Store Driver is a core transport component which lives both on the Mailbox server role (as the mail submission service) and the Hub server role. It is responsible for:

  • Retrieving messages from the mailbox server that have been submitted by end-users and submitting those to the Hub transport role for categorization and routing.
  • Delivering messages to the appropriate mailbox server based on the location of the recipients mailbox.
  • Extensibility platform for both mail submission & delivery. Store Driver currently hosts a number of agents that extend the functionality of Exchange. Examples include such agents as Inbox Rules, Conversations, meeting forward notifications, etc.

Exchange 2010 is currently being utilized in Live@EDU, as well as the upcoming Office 365. As you can probably imagine, the Exchange servers that run in those datacenters are loaded and pushed harder than almost any other Exchange server imaginable. Prior to SP1, there were several problems that were encountered with mail delivery to the Exchange mailbox store. In particular, there was a need to make sure that a handful of recipients did not starve the rest of the mail delivery system.

While many of you may not have noticed this problem, Microsoft has seen many of these types of cases over the years; often isolated to a single event like an inadvertent public folder replication storm.

This was despite the message throttling that was already available. Transport roles have also had functionality to avoid resource starvation known as Back Pressure, but this was not designed to protect the system from messages that were already in the Local Delivery queue.

Changes in SP1

In order to further protect both the Mailbox servers and Hub servers from resource starvation, new thread limits were introduced in SP1:

KeyDescriptionScenarioError in Connectivity Log:
<add key=”RecipientThreadLimit” value=”1”/>Limit beyond which no more threads can be allocated to the recipient for delivery.

Note: If this is increased, you should increase MaxMailboxDeliveryPerMdbConnections as well, so that slow or hung deliveries to a single recipient will not block delivery for the entire MDB.

Flood of messages to a single Mailbox or a performance problem associated with a single mailbox, has minimal impact on delivery to the rest of the Mailboxes in the database.Throttled delivery for recipient <recipient> due to concurrency limit <limit>
<add key=”MaxMailboxDeliveryPerMdbConnections” value=”2”/>The maximum number of concurrent connections to a single “healthy” Mailbox Database.

Database health is determined by the Health Monitor API and recorded in the connectivity logs as a value between -1, 0-100. 100 being healthy.

Connections hang to a single problematic database have minimal impact on delivery of other queued messagesThrottled Delivery due to server limit for <server FQDN> with threshold

Note: These keys are not present in the EdgeTransport.exe.config file by default.

Is it possible to have too much protection?

Unfortunately, there are two scenarios after applying SP1 where we are seeing customers with messages backing up in the queue. The temporary error message is:

432 4.3.2 STOREDRV.Deliver; recipient thread limit exceeded

As you can probably guess, the two scenarios are:

  • Journaling
  • Public Folders

In both cases, the deliveries are occurring to a single recipient (or very small number of recipients). This is likely to occur during heavy mail flow. The screen shot below was taken from a lab server while reproducing the issue:

Screenshot: Messages backed up in mailbox delivery queue due to recipient thread limits
Figure 1: Messages backed up in mailbox delivery queue due to recipient thread limits being exceeded (click here for larger screenshot)

You can see a historical history of 4.3.2 events in connectivity logs on your Hub Transport servers (in the \Program Files\Microsoft\Exchange Server\V14\TransportRoles\Logs\Connectivity\CONNECTLOGxxxxxxxx-x.LOG), like:

#Software: Microsoft Exchange Server
#Version: 14.0.0.0
#Log-type: Transport Connectivity Log
#Date: 2011-01-12T00:00:00.775Z
#Fields: date-time,session,source,Destination,direction,description
 
2011-01-12T00:00:00.775Z,08CD7F1200CBDBD0,MapiSubmission,5f24e416-c380-41b5-bfe0-37b6f1091f49,>,"Failed; HResult: 1140850693; DiagnosticInfo: Stage:LoadItem, SmtpResponse:432-4.3.2 STOREDRV; mailbox server is too busy"
 
2011-01-12T00:00:00.775Z,08CD7F1200CBDBD0,MapiSubmission,5f24e416-c380-41b5-bfe0-37b6f1091f49,-,RegularSubmissions: 0 ShadowSubmissions: 0 Bytes: 0 Recipients: 0 Failures: 1 ReachedLimit: False Idle: False
 
2011-01-12T00:00:05.792Z,08CD7F1200CBDBD1,MapiSubmission,5f24e416-c380-41b5-bfe0-37b6f1091f49,+,Win2k8R2Ex14.dom2k8r2ex14.lab

In some cases, simply leaving the servers alone should cause the queues to slowly drain. In other cases, it may be necessary to take further action because the problem has persisted for a while or because it isn’t part of a one-time event like a Public Folder replication storm.

Alright, I understand. Now how do I fix my situation?

Like every other throttling & performance related feature that has ever been in Exchange, the solution isn’t exactly straight forward. For starters, we’ve seen some level of success simply incrementing both values up one, as follows:

<add key="RecipientThreadLimit" value="2" />
<add key="MaxMailboxDeliveryPerMdbConnections" value="3" />

In fact, there has been enough success with this that we’re considering changing the defaults in a future rollup or service pack. Of course, when we do, the new defaults will only apply to those who haven’t already modified the values. Although it has not yet been released, KB 2491972 will discuss the change when the time comes.

So if +1 is better, then why not +2 or more?

Well, the problem is that all Exchange servers will ultimately be bound by some hardware resource. You don’t want to introduce thrashing or resource starvation due to a public folder or journaling server event that now impacts all users as well. In addition, there are other limits that control the maximum number of threads that can service these types of deliveries. In short, we are not recommending going above 4 for MaxMailboxDeliveryPerMdbConnections, and RecipientThreadLimit should always be at least one fewer.

In an extreme case, if you are in a very busy environment with dedicated journaling mailbox servers, it may be worth considering having dedicated hub transport servers to go along with that. Of course, they can be virtualized or multi-role boxes, but in order to be isolated, the whole bunch will need to be in a dedicated site. Then, you would be able to increase these limits without risking delivery to other mailboxes.

Of course, this is an extreme example. For the rest of us, it may be as simple as trying the +1 approach while carefully monitoring the hub & mailbox servers.

Scott Landry, Steve Schiemann, Frank Brown and Jason Nelson

Now Available: Office 365 Mail Flow Troubleshooter

$
0
0

Can't send or receive email? The Mail Flow Guided Walkthrough (GWT) can help.

Problems with mail delivery can be a very frustrating for both the user and the administrator. Unfortunately, mail flow issues aren't uncommon and will likely occur at some point in time whether your mailboxes are hosted on-premises, in Office 365, or a combination of both.

To help you troubleshoot mailflow issues, we've just released the Mail Flow Guided Walkthrough (GWT). You can use the walkthrough for troubleshooting issues sending and receiving mail or when mail is delayed in the following scenarios:

  • The sender’s mailbox is hosted on Office 365 and the recipient’s mailbox is outside your organization.
  • The sender’s mailbox is outside your organization and the recipient’s mailbox is hosted in Office 365.
  • The sender’s and recipient’s mailboxes are both located in Office 365.
  • The sender’s mailbox is hosted in Office 365 and the recipient’s mailbox is located on an on-premise Exchange server and both users are in the same organization.
  • The sender’s mailbox is hosted on an on-premise Exchange server and the recipient’s mailbox is hosted in Office 365 and both users are in the same organization.

The goal of this walkthrough is to assist you in resolving these issues in a timely manner by focusing on the scoping and steps used to isolate and resolve problems.

I’d like to thank everyone who contributed to the development of this troubleshooter with special recognition going to the following folks: Tom Kern, Nitin Shukla, Sainath Vijayaraghavan, Jim Martin, Bruce Wilson, Stephen Gilbert, Scott Landry, Charlotte Raymundo, Mary Browning, Star Li, Chen Jiang, Victor Zhang.

Joe Turick

New Remote Connectivity Analyzer Tests for Mail Flow

$
0
0

We’re happy to announce that we’ve added some tests to Microsoft Remote Connectivity Analyzer (RCA), to help you test your mail flow configuration. These tests are intended for customers who use the Exchange Online Protection service to perform spam and malware filtering before sending email messages to your email servers. You can run these tests when setting up the service, or whenever you want to verify that your mail flow is set up correctly.

About Microsoft Remote Connectivity Analyzer (RCA)

Microsoft Remote Connectivity Analyzer is a web site that allows you and your users to quickly test connectivity, availability & functionality of your on-premises Exchange and Lync servers and Office 365 services. You can access it at exrca.com. For more details about the variety of tests included in RCA, see What’s new with Microsoft Remote Connectivity Analyzer? A lot!

The Verify MX Record and Outbound Connector Test, shown in the image below, verifies that the MX record for your domain points to EOP, so that mail is routed to EOP for filtering before it reaches your mailboxes. This test also verifies that you have an Outbound on-premises connector configured to deliver email to your on-premises environment.

Screenshot: Remote Connectivity Analyzer - Verify MX Record and Outbound Connector test
Figure 1: Verify MX Record and Outbound Connector Test

The Verify Service Delivery Test verifies delivery from the service to your on-premises environment by testing the connection between the service and your IP addresses or fully qualified domain names (FQDNs) defined in your Outbound on-premises connector.

For more information about how to run these tests, see Test Mail Flow With the Remote Connectivity Analyzer.

We welcome any feedback; please send comments to the following email address: exrcafb@microsoft.com.

Exchange Online Protection (EOP) Team

Restricting email to the Internet on a per user AND per domain basis

$
0
0

You requested it... and we delivered it in Exchange 2010!

One of the most requested items in exchange 2007 was something like this...

...we have 5-12 external domains that we need to allow some users to send to, but prevent sending to all other domains...

Or like this...

...we need a way to allow everyone to send to the internet but restrict members of 'contract workers group' to just certain domains. 

This blog post is meant to show how easy it now is to accomplish this oft heard request in Exchange 2010. Transport rules, introduced with Exchange 2007, provided a lot of new options for administration of mail resulting in even more requests for additional functionality. The rules now have new predicates and actions extending the possibilities of what can be done.

In particular, the predicates for address matching that were previously only available on the Edge role are now available for Hub role as well!

For more information about the new predicate and actions see the following links below:

Exchange 2010 Transport Rule Predicates:
http://technet.microsoft.com/en-us/library/dd638183.aspx

Exchange 2010 Transport Rule Actions:
http://technet.microsoft.com/en-us/library/aa998315.aspx

So I will use the 2nd "request" above to demonstrate how to create a rule in 2010 to accomplish it.

For our example, the rule will restrict "Active Directory Mail enabled users" who have their 'Department' defined as 'Temp Employees' from sending mail to the internet, except they must be allowed to send to 2 external domains called: 'partnerdomain.com' and 'fourthcoffee.com'. Additionally, to reduce Helpdesk calls, you want to send an NDR when they violate the rule. For demonstration purposes I will use 2 Conditions, one Action and one Exception.

Creating a new rule

1. Conditions

a. First condition:

"Sent to users that are inside or outside the Organization, or partners"

Screenshot #1 above, set the dropdown to Outside the Organization option

b. Second condition:

"When the sender's properties match text patterns".

Now note the new options with this in the 3rd screenshot below allowing selection of Active Directory properties on the user object!

Here we will be using the 'Title' property to match the rule to a sender.

2.Actions

"Send rejection message to sender with enhanced status code". The text you add here is displayed in the "Diagnostic information for administrators:" section of the NDR and can say whatever you wish.  Originally I started out with "You may only send internet mail to @fourthcoffee.com and partnerdomain.com".

While the NDR provides the information, it is somewhat 'hidden' to be practical for your typical user, so I will create a customized DSN. At this point, all we need to do is specify the text and enhanced status code for our administrators.  The new text will be "Diagnostic information for System Administrators" and we specified a specific and unique error code 5.7.122 that is easy for administrators to associate with this rule, should troubleshooting be necessary.

3.Exceptions

"Except when a recipient's address matches text patterns". This is where we add domains that these senders are allowed to send mail to on the "Specify text patterns" dialog box.

And finally, this is the customized NDR that senders receive when violating the rule we created. This test was to two recipients where one is an allowed domain, Janer@fourthcoffee.com, and another is not an allowed domain: mthomas@e2k3.dom.

Notice how the NDR was only generated for the rejected recipient.  All other recipients were allowed through.

For more information:

- Understanding Transport Rules
http://technet.microsoft.com/en-us/library/dd351127.aspx

- Understanding How Transport Rules Are Applied
http://technet.microsoft.com/en-us/library/bb124703(EXCHG.140).aspx

- Create a Custom DSN
http://technet.microsoft.com/en-us/library/aa996803.aspx

- Associating a DSN Message with a Transport Rule
http://technet.microsoft.com/en-us/library/bb123506(EXCHG.80).aspx

- Dave Forrest
(
Contributions by Scott Landry, Stephen Gilbert and Steve Clagg)

Making sense of Exchange Logs using ExLogAnalyzer

$
0
0

Early 2008 we have posted a blog entry with a VB script that generates some pre-canned reports that are based on message tracking logs. The script has proven to be useful in understanding Microsoft's Exchange work load and guide some design decision for Exchange 2010. This script was developed by Todd Luttinen, Principal Program Manager at Microsoft.

During the development of Exchange 2010, we needed to extended our log analysis beyond just message tracking and to answer a variety of questions that assist with design decisions. This exposed a bottle neck with having a single script that has all the parsing and analyzers bundled together.

This resulted in the creation of ExLogAnalyzer by Victor Boctor, Principal Architect at Microsoft. ExLogAnalyzer was developed in C# with the following goals:

  • Separation of syntax and semantics.
  • Multi-Server support (process log files that span multiple servers). Log events across servers are processed in chronological order.
  • Multi-Log Type support (process / cross reference logs of different log types to produce a single report). Log events across log types are processed in chronological order.
  • Provide an extensibility model to support rapid development and distribution of extensions (to support new log types) and analyzers (to encapsulate reporting logic).
  • Ability for the community to develop their own analyzers or even extensions.
  • Support for Exchange 2007 / 2010 log types.

The main shift in this model, compared to the previous script, is that ExLogAnalyzer is built as a framework that can be used to analyze Exchange as well as possibly any other log format. New log types are supported via plugins called "extensions". Extensions are responsible for doing all the parsing and converting of log lines into events, where each event triggers a method and passes all the pre-parsed information as the event arguments. The specific reports are also implemented as plugins known as "analyzers", where each analyzer handles the events it is interested in and does the appropriate accounting and report generation (typically in CSV format). Implementing each analyzer in isolation (rather than one script that answers multiple questions) makes it much simpler to develop, understand and distribute such analyzers. Such extensions and analyzers can also be easily shared given the plugin model. The following simple diagram summarizes the architecture of this tool:

The ExLogAnalyzer is now released to the community with the following extensions / analyzers available out of the box:

  • Message Tracking Log
    • MsgTrkTopSendersByDeliverLogAnalyzer - Generates the top 1000 senders based on mailbox deliveries. Messages to the internet are not counted.
    • MsgTrkTopSendersBySubmitLogAnalyzer - Provides an analysis of the sender load distribution based on number of messages sent from their mailboxes.
    • MsgTrkTopRecipientLogAnalyzer - Generates the top 1000 recipients based on mailbox deliveries. Messages to the internet are not counted.
    • MsgTrkMessageSizeDistributionLogAnalyzer - Provides an understanding of the message size distribution.
    • MsgTrkRecipientNotFoundLogAnalyzer - Discover and summarize recipients for which "Recipient Not Found" error was generated.
    • MsgTrkMailflowVisualizerLogAnalyzer - Generates a directed graph showing the server being analyzed and all the inbound / outbound mail flow paths.
    • MsgTrkComponentLatencyPercentileLogAnalyzer (E14) - Analyzes the latencies of the different components and determines the latencies experienced by the specified percentiles of messages.
    • MsgTrkDuplicateDeliveryLogAnalyzer - Analyzes the sources for duplicate deliveries to Store. Note that end users don't see such duplicates.
    • MsgTrkEventFrequencyLogAnalyzer - Provides an understanding of the distribution of the event + source combinations.
    • MsgTrkEventTimeDistributionLogAnalyzer - Provides an understanding of the event distribution over time with a per hour resolution.
    • MsgTrkExpandLogAnalyzer - Analyzes the distribution list expansion load on the system.
    • MsgTrkReceiveLogAnalyzer - Analyzes the distribution of the sources for the messages received by a server or a set of servers.
  • Smtp Receive Log
    • SmtpReceiveWorkLoadLogAnalyzer - Analyzes the SMTP receive work load over time while tracking tarpitting, client time outs, etc.
    • SmtpReceiveDelayedAckLogAnalyzer (E14) - Analysis of delayed ack performance over time. This report provides an overview of the redundancy that is achieved for legacy systems via delayed ack.
    • SmtpReceiveFormatterLogAnalyzer - Re-writes the logs with each session in a separate file, it also reformats the log so that the common session information is included in the header, hence, making the session details more readable.
    • SmtpReceiveSeparatorLogAnalyzer - Re-writes the logs with each session in a separate file while maintaining the exact log format.
    • SmtpReceiveSessionIndexLogAnalyzer - Provides a summary of all sessions processed within the provided logs.
  • Connectivity Log
    • ConnectivityWorkLoadLogAnalyzer - An analyzer that samples the connections over time. This analyzer generates a CSV file per source (e.g. SMTP or MAPI).
    • ConnectivityStatsLogAnalyzer - An analyzer that provides the frequency of sessions, failed and DNS failures per source + destination combination.
    • ConnectivityFormatterLogAnalyzer - Re-writes the sessions as a file per session, moved all the common session information to the header to make the sessions more readable.

Sample Reports

Following are some samples to provide a feel of the outputs of some of these analyzers.

Mail Flow Visualizer (demonstrated possible visualization using directed graphs):

Message Size Distribution:

SmtpReceiveFormatterLog (log re-writing for splitting sessions and making them more readable):

# Session Id: 08CBDCECE3DDF231
# Start Time (local): 2009-07-28T11:07:46.922
# End Time (local): 2009-07-28T11:07:46.953
# Start Time (UTC): 2009-07-28T18:07:46.922Z
# End Time (UTC): 2009-07-28T18:07:46.953Z
# Disconnect Type: Local
# Connector Id: MyServer\MyServer_CrossForest
# Local End Point: 157.54.7.153:25
# Remote End Point: 157.54.71.39:4183

0000000,+,,
0000000,*,None,Set Session Permissions
0000000,*,SMTPSubmit SMTPAcceptAnyRecipient SMTPAcceptAuthenticationFlag SMTPAcceptAnySender SMTPAcceptAuthoritativeDomainSender BypassAntiSpam BypassMessageSizeLimit SMTPAcceptEXCH50 AcceptRoutingHeaders AcceptForestHeaders AcceptOrganizationHeaders SMTPAcceptXShadow,Set Session Permissions
0000000,>,220 MyServer E14 Cross Forest,
0000000,<,EHLO otherhost.otherforest.microsoft.com,
0000000,>,250-MyServer.redmond.corp.contoso.com Hello [157.54.71.39],
0000000,>,250-SIZE 10485760,
0000000,>,250-PIPELINING,
0000000,>,250-DSN,
0000000,>,250-ENHANCEDSTATUSCODES,
0000000,>,250-AUTH,
0000000,>,250-8BITMIME,
0000000,>,250-BINARYMIME,
0000000,>,250-CHUNKING,
0000000,>,250-XEXCH50,
0000000,>,250 XSHADOW,
0000000,<,XSHADOW 3333YTkxYjEtYzE1OC00NDcxLWI4OTktMDA2NDI5YmVmZWRlQFRLNUVYMTRNTFRXNjUxLndpbmdyb3VwLndpbmRlcGxveS5udGRldi5taWNyb3NvZnQuY39t,
0000000,>,250 q7rdaFIdKk3NNRTbjRsjrQ==,
0000000,<,MAIL FROM:<sender@contoso.com> SIZE=25477 XSHADOW=70136df4-c89b-4700-9654-b642c4eb78bb,
0000000,*,08CBDCECE3DDF231;2009-07-28T18:07:46.922Z;1,receiving message
0000000,<,RCPT TO:<receiver@contoso.com> ORCPT=rfc822;receiver2@contoso.com,
0000000,>,250 2.1.0 Sender OK,
0000000,>,250 2.1.5 Recipient OK,
0000000,<,XEXCH50 1136 2,
0000000,>,354 Send binary data,
0000015,>,250 2.0.0 XEXCH50 OK,
0000015,<,BDAT 25477 LAST,
0000031,>,250 2.6.0 <DB82FD8C490D4F43ACE766C04B23A7050F0F12@someserver.otherforest.contoso.com> [InternalId=16796908] Queued mail for delivery,
0000031,<,XQDISCARD 50,
0000031,>,251 OK, no discard events,
0000031,<,QUIT,
0000031,>,221 2.0.0 Service closing transmission channel,
0000031,-,,Local

Top Senders by Submit (analysis yielding CSV - full report has top 1000):

MailboxServer

Sender

Count

mbx01.contoso.com

support_person@contoso.com

162

mbx01.contoso.com

sales_person@contoso.com

124

mbx02.contoso.com

ceo@contoso.com

61

Sender Distribution by Submit (analysis yielding CSV):

SentMsgRange

Count

Percent

Percentile

1-5 msgs

23310

86.59%

86.59%

6-10 msgs

3078

11.43%

98.02%

11-20 msgs

497

1.85%

99.87%

21-30 msgs

28

0.10%

99.97%

31+ msgs

7

0.03%

100.00%

Distribution Group Expansion Analyzer (analysis yielding CSV):

Recipient

RecipCount

ExpandCount

info@contoso.com

1

2242

skiing@contoso.com

43

848

parents@contoso.com

223

203

all@contoso.com

2325

17

Getting started

  • Download ExLogAnalyzer from here.
  • Checkout the Power Point slide deck included in the download for more details about ExLogAnalyzer.
  • Use ExLogAnalyzer and its distributed sample analyzers to analyze your logs.
  • Develop your own analyzers. Visual Studio and Visual C# Express Edition are the recommended tools. However, you can use Notepad or your favorite editor, given that ExLogAnalyzer detects and compiles the analyzer CSharp files at runtime.
  • Provide us with feedback about ExLogAnalyzer, sample analyzers or the development process.
  • Share your analyzers or ideas for useful new analyzers with the Exchange community.

- Victor Boctor

Transport Rules: Exception to the Rule

$
0
0

When constructing Transport Rules, it is pretty straight forward to define a set of conditions and then specify the action to take when those conditions are met. It is easy to overlook an optional third component: Exceptions. Several customer questions that I have come across for how to enforce more complex policies were solved through the use of exceptions in their rule constructions. This article will present some example customer scenarios to help illustrate how exceptions can be used in Transport Rules.

I won't go into a full overview of what Transport Rules are, or how they are managed (e.g., EMC, ECP, or PowerShell) in this article. If you are unfamiliar with the Exchange 2010 Transport Rules features, you may find it useful to first read the Transport Rule documentation on TechNet.

What are transport rule exceptions?

Transport rule exceptions look very similar to transport rule conditions. Transport rule conditions are used to identify which messages are to have the transport rule action applied to them; however, exceptions are used to exclude specific messages from the transport rule action. Exceptions are essentially loopholes in the transport rule, overriding the conditions and preventing a transport rule action from being applied to an e-mail message.

You can configure multiple exceptions in a given transport rule, and it is important to understand that the logical relationship of these exceptions is such that if any one of the exceptions evaluates as true, then the message bypasses the rule - even if all of the conditions are met. To further explain the logical relationships in a transport rule:

Condition 1
AND
Condition 2
AND
Condition 3

All of these conditions must be TRUE for the action to be performed

Action 1

This is the action performed on the message

Exception 1
OR
Exception 2
OR
Exception 3

None of these conditions can be TRUE for the action to be performed.  In other words: if any of these conditions are TRUE, then do not perform the action.

To view a full list of predicates that you can use for transport rule exceptions, see Transport Rule Predicates in Exchange 2010 documentation.

Below are some example scenarios in which using exceptions are critical to meeting the organization's policy goals. Note that with the rich flexibility of transport rules there is often more than one way to construct a rule - the scenarios below are just examples to highlight the use of exceptions, and in many cases you could use different conditions to accomplish the same or similar goals.

Scenario 1: Restrict to the same organizational division

In this scenario, Contoso has a group of users that are working on a top secret project, and due to the sensitive nature of this project, these users should not be communicating project data with anyone outside of the project. Members of the secret project team can freely communicate with other members of the top secret project, and with the Human Resources department. Messages sent outside of these allowances must be approved by the team manager before delivery.

Note that a company's policy statement may not match one-to-one with the logical components in the transport rule structure, so it may be necessary to restructure the policy statement into a Condition/Action/Exception logic for the transport rule. In the example above, we can recompose the policy statement to say:

All messages sent from members of the top secret project team must be moderated by the team manager, except for messages sent to Human Resources or between members of the secret project team.

Then to enforce this policy, the Contoso Exchange admin creates this Transport Rule:

Conditions

Apply rule to messages
from a member of 'Project X'

Actions

Forward the message to 'Joe Manager' for moderation

Exceptions

Except when the message is sent to a member of 'Human Resources'
  OR except when the message is sent between members of 'Project X' and 'Project X'

Scenario 2: Closed perimeter; only allow privileged users or specific external domains

In this scenario (also known as the "Closed Campus" scenario), Contoso wishes to lock down their email perimeter to only allow internal communications. Users are not allowed to send or receive messages outside of the organization, unless they are members of a privileged group or the communication is with a specific partner e-mail domain.

There are several different ways to do achieve this goal, but the key is still in configuring the Exceptions in a transport rule. For example, if Contoso wants to block all outbound messages except messages to fabrikam.com...

Conditions

Apply rule to messages
sent to users that are "Outside the organization"

Actions

Send a rejection notice "You are not permitted to send e-mail to people outside of this organization" to the sender with the status code "5.7.1"

Exceptions

Except when a recipient's address contains "fabrikam.com"

By default all employee messages from Contoso to an external address will be blocked, except for external recipients with fabrikam.com in their email address (for example, "ed.banti@fabrikam.com"). Then, Contoso wants to additionally lift the restriction for a specific group of privileged Contoso users, so they add the following exception to the rule:

Exceptions

Except when a recipient's address contains "fabrikam.com"
OR except when the message is from a member of "Privileged Users"

Finally, this scenario will actually need two transport rules to be complete. The rule to control outbound messages is shown above. Another rule to control inbound messages is needed, and would look like this:

Closed Perimeter - Inbound

Conditions

Apply rule to messages
sent to users that are "Outside the organization"

Actions

Send a rejection notice "You are not permitted to send e-mail to people outside of this organization" to the sender with the status code "5.7.1"

Exceptions

Except when a recipient's address contains "fabrikam.com"
OR except when the message is from a member of "Privileged Users"

Scenario 3: Closed perimeter, with a twist

Now, let's twist the previous scenario - let's say that you want to block all outbound external messages unless the sender is in a privileged group AND it is to a specific external domain. You will remember from earlier in this article that multiple exceptions in a single rule are in a logical "OR" relationship, so how do we accomplish this goal?

Answer: you need multiple rules that fire in sequence (remember, that transport rules fire in order of their priority value). If you break up enforcement of this policy into two stages, you can ensure that both exceptions have to be matched before letting the message out of the organization. For example:

Outbound Rule 1 (priority = 1)

Conditions

Apply rule to messages
sent to users that are "Outside the organization"

Actions

Send a rejection notice "You are not permitted to send e-mail to people outside of this organization" to the sender with the status code "5.7.1"

Exceptions

Except when the message is from a member of "Privileged Users"

Outbound Rule 2 (priority = 2)

Conditions

Apply rule to messages
sent to users that are "Outside the organization"

Actions

Send a rejection notice "You are not permitted to send e-mail to people outside of this organization" to the sender with the status code "5.7.1"

Exceptions

Except when a recipient's address contains "fabrikam.com"

The first rule will only allow outbound messages from members of the Privileged Users group, and the second rule will then only allow the privileged senders to send mail to the fabrikam.com email domain.

Other scenarios:

The Technet online help for Exchange 2010 has some additional Transport Rules scenario examples, which rely on exceptions. I won't repeat the configuration details here, but I've provided links to the relevant articles below:

  • Disclaimers: an exception is used to prevent the application of a disclaimer where one already exists.
  • Ethical Wall: an exception (in the PowerShell example) is used to allow Executives in restricted groups to communicate with each other.

If you have other example transport rules that you've implemented, in which the use of exceptions were key to meeting your policy goals, please share them with the rest of the community by posting them up in comments to this blog post. Thanks!

-- Steve Clagg


Playing Shell Dojo with Transport Rules

$
0
0

To enforce messaging policies, organizations frequently need to inspect messages based on different properties such as sender, recipients, subject, headers and attachments, and take the necessary actions such as adding disclaimers, adding headers, adding a prefix to the message subject, setting or modifying the SCL, adding a recipient, and rejecting a message. In Exchange 2007, we introduced transport rules to allow organizations to apply messaging policies, removing the need to write transport event sinks.

Exchange 2007 also introduced the Exchange Management Shell (EMS), built on Windows PowerShell, as a way to automate routine tasks and bulk operations. The shell uses a fairly simple syntax, and helps you perform tasks by using easy-to-understand cmdlets.

Exchange 2010 takes it further with many more capabilities, including the ability to manage your Exchange 2010 servers from a remote computer using Remote Shell. More details in Overview of Exchange Management Shell in Exchange 2010 documentation.

In this post, we’ll take a look at how transport rules can be created and managed in Exchange 2007, and how it’s been simplified in Exchange 2010. For creating one-off or a small number of transport rules, the transport rules wizard in EMC provides an easy-to-use interface. The shell can help you easily automate the process, and consistently create, test and implement transport rules. You can use the tool that best meets your needs.

Creating Transport Rules in Exchange 2007

In Exchange 2007, you create transport rules using the New-TransportRule cmdlet, and modify them using the Set-TransportRule cmdlet. However, the predicates used to create the conditions and exceptions for the rule, as well as the actions to be used in a rule, need to be instantiated first.

In this example, we create a transport rule to implement an ethical wall between the Brokers and Bankers distribution groups.

Before you create a transport rule, you must select the transport rule predicates and actions you want to use for the rule, and determine the predicate and action properties you will need to specify. You can either use the Get-TransportRulePredicate and Get-TransportRuleAction cmdlets, or refer to Transport Rule Predicates and Transport Rule Actions in Exchange 2007 documentation.

To create an ethical wall firewall, you need to use the BetweenMemberOf predicate. Let's find out the properties you must specify for this predicate.

Get-TransportRulePredicate BetweenMemberOf | fl

The output:

Addresses :
Addresses2 :
LinkedDisplayTextException : except when the message is sent between members of
distribution list and distribution list
Name : BetweenMemberOf
Rank : 6
LinkedDisplayText : between members of <a id="Addresses">distribution
list</a> and <a id="Addresses2">distribution list</a>

The BetweenMemberOf predicate requires you to specify two values— Addresses, and Addresses2.

  • Step 1: Instantiate the BetweenMemberOf predicate

    $condition = Get-TransportRulePredicate BetweenMemberOf

     

  • Step 2: Add the values to the new condition we instantiated. As seen in step 1, the BetweenMemberOf predicate requires two values— the identity of two distribution groups.

    $condition.Addresses = @(Get-DistributionGroup Brokers)
    $condition.Addresses2 = @(Get-DistributionGroup Bankers)

  • Step 3: Instantiate the RejectMessage action

    $action = Get-TransportRuleAction RejectMessage

  • Step 4: Add value to the action we instantiated

    $action.RejectReason = "Members of Bankers and Brokers distribution groups are not allowed to send email to each other."

  • Step 5: Create the new rule and add the instantiated condition and action to it.

    New-TransportRule -Name "EthicalWall" -Condition @($condition) -Action @($action)

Creating a Transport Rule in Exchange 2010

In Exchange 2010, we’ve made the following changes to the transport rule cmdlet experience based on your feedback.

  • You’re no longer required to instantiate predicates and actions
  • All predicates and actions are available in-line as parameters of the New-TransportRule and Set-TransportRule cmdlets, resulting in a much improved experience.
  • You can now create and modify transport rules using a single command!

Find The Parameter

Before we start creating rules using the shell, we must understand the relationship between predicates, predicate properties, and parameters. Remember, all properties are now parameters for the New-TransportRule and Set-TransportRule cmdlets! So, Properties = Parameters. The key is to determine the predicate or action you want to use and find the parameters it requires.

Exchange 2010 has many new predicates and actions. The Get-TransportRulePredicate and Get-TransportRuleAction cmdlets let you easily list them, and also determine the properties required for each. You can also look up Exchange 2010 predicates and actions in Transport Rule Predicates and Transport Rule Actions in Exchange 2010 documentation.

Using the Get-TransportRulePredicate cmdlet provides the following output:

NameRankLinkedDisplayText
---- ---------------------
From0from <a id="From">people</a>
FromMemberOf1from a member of <a id="FromMemberOf">distribution list</a>
FromScope2from users that are <a id="FromScope">inside or outside the organization</a>
SentTo3sent to <a id="SentTo">people</a>
SentToMemberOf4sent to a member of <a id="SentToMemberOf">distribution list</a>
SentToScope5sent to users that are <a id="SentToScope">inside or outside the organization, ...
BetweenMemberOf6between members of <a id="BetweenMemberOf1">distribution list</a> and <a id="Be...
ManagerIs7when the manager of any <a id="ManagerForEvaluatedUser">sender</a> is <a id="Ma...
ManagementRelationship8when the sender is the <a id="SenderManagementRelationship">manager</a> of a re...
ADAttributeComparison9if the sender and recipient's <a id="ADComparisonAttribute">AD Attribute</a> ar...
RecipientAddressContainsWords10when a recipient's address contains <a id="RecipientAddressContainsWords">speci...
RecipientAddressMatchesPatterns11when a recipient's address matches <a id="RecipientAddressMatchesPatterns">text...
RecipientAttributeContains12when a recipient's <a id="RecipientADAttributeContainsWords">properties contain...
RecipientAttributeMatches13when a recipient's <a id="RecipientADAttributeMatchesPatterns">properties match...
AnyOfToHeader16when any of the recipients in the To field is <a id="AnyOfToHeader">people</a>
AnyOfToHeaderMemberOf17when any of the recipients in the "To" field is a member of <a id="AnyOfToHeade...
AnyOfCcHeader18when any of the recipients in the Cc field is <a id="AnyOfCcHeader">people</a>
AnyOfCcHeaderMemberOf19when any of the recipients in the Cc field is a member of <a id="AnyOfCcHeaderM...
AnyOfToCcHeader20when any of the recipients in the To or Cc fields is <a id="AnyOfToCcHeader">pe...
AnyOfToCcHeaderMemberOf21when any of the recipients in the To or Cc fields is a member of <a id="AnyOfTo...
HasClassification22marked with <a id="HasClassification">classification</a>
SubjectContains23when the Subject field contains <a id="SubjectContainsWords">specific words</a>
SubjectOrBodyContains24when the Subject field or message body contains <a id="SubjectOrBodyContainsWor...
HeaderContains25when the <a id="HeaderContainsMessageHeader">message header</a> contains <a id=...
FromAddressContains26when the From address contains <a id="FromAddressContainsWords">specific words</a>
SubjectMatches27when the Subject field matches <a id="SubjectMatchesPatterns">text patterns</a>
SubjectOrBodyMatches28when the Subject field or the message body matches <a id="SubjectOrBodyMatchesP...
HeaderMatches29when the <a id="HeaderMatchesMessageHeader">message header</a> matches <a id="H...
FromAddressMatches30when the From address matches <a id="FromAddressMatchesPatterns">text patterns</a>
AttachmentNameMatches31when any attachment file name matches <a id="AttachmentNameMatchesPatterns">tex...
SCLOver32with a spam confidence level (SCL) rating that is greater than or equal to <a i...
AttachmentSizeOver33when the size of any attachment is greater than or equal to <a id="AttachmentSi...
WithImportance34marked with <a id="WithImportance">importance</a>
MessageTypeMatches35if the message type is <a id="MessageTypeMatches">Message Type</a>
SenderAttributeContains36when the sender's <a id="SenderADAttributeContainsWords">properties contain spe...
SenderAttributeMatches37when the sender's <a id="SenderADAttributeMatchesPatterns">properties match tex...
HasNoClassification38not marked with a message classification<a id="HasNoClassification"></a>
AttachmentContainsWords39when an attachment's content contains <a id="AttachmentContainsWords">words</a>
AttachmentMatchesPatterns40when an attachment's content matches <a id="AttachmentMatchesPatterns">text pat...
AttachmentIsUnsupported41when an attachment is unsupported<a id="AttachmentIsUnsupported"></a>

Predicates can also be used as exceptions. Each predicate property (available as a transport rule parameter— e.g. BetweenMemberOf1 and BetweenMemberOf2, or From) also has an identical twin parameter with the prefix ExceptIf (for example, ExceptIfBetweenMemberOf1 and ExceptIfBetweenMemberOf2, or ExceptFrom). You can see how transport rule exceptions are used in some interesting ways in Steve Clagg's post Transport Rules: Exception to the Rule.

Similarly, using the Get-TransportRuleAction cmdlet lists all available actions:

Name RankLinkedDisplayText
---- ---------------------
PrependSubject0prepend message subject with <a id="PrependSubject">string</a>
ApplyClassification1apply <a id="ApplyClassification">message classification</a>
ApplyHtmlDisclaimer2<a id="ApplyHtmlDisclaimerLocation">append</a> <a id="ApplyHtmlDisclaimerText">discla...
RightsProtectMessagev 3rights protect message with <a id="ApplyRightsProtectionTemplate">RMS template</a>
SetSCL4set the spam confidence level to <a id="SetSCL">value</a>
SetHeader5set <a id="SetHeaderName">header</a> with <a id="SetHeaderValue">value</a>
RemoveHeader6remove <a id="RemoveHeader">header</a>
AddToRecipient7add a recipient in the To field <a id="AddToRecipients">addresses</a>
CopyTo8copy the message to <a id="CopyTo">addresses</a>
BlindCopyTo9Blind carbon copy (Bcc) the message to <a id="BlindCopyTo">addresses</a>
AddManagerAsRecipientType10add the sender's manager as a <a id="AddManagerAsRecipientType">specific</a> recipien...
ModerateMessageByUser11forward the message to <a id="ModerateMessageByUser">addresses</a> for moderation
ModerateMessageByManager12forward the message to the sender's manager for moderation<a id="ModerateMessageByMan...
RedirectMessage13redirect the message to <a id="RedirectMessageTo">addresses</a>
RejectMessage14send <a id="RejectMessageReasonText">rejection message</a> to sender with <a id ="Rej...
DeleteMessage15Delete the message without notifying anyone<a id="DeleteMessage"></a>

Once you've determined the predicate you need to use in a rule, you can list all the properties it requires. Some predicates require a single property, so the predicate name and the parameter name (used with New/Set-TransportRule cmdlets) are the same. For example, the From predicate takes a single property— an array of senders. The parameter is also called From. Some predicates require multiple properties. For example, the ADAttributeComparison predicate requires you to specify the name of the Active Directory attribute you want to compare, and a comparision operator (equal / not equal). The parameters are called ADComparisonAttribute and ADComparisonOperator.

You can simply cycle through (hit -, followed by the Tab key— known as "tab-complete" or "tab-through" in shell-speak... ) all available parameters of the New-TransportRule and Set-TransportRule cmdlets and chances are you would recognize the ones you need to use when they show up. If you remember the parameter name starts with the letter B, you can type that first letter and tab through all parameters starting with the letter B (New-TransportRule "Rule Name" -B + the Tab key to tab-through). You've just narrowed down the number of parameters to 3 - that's a lot less tabbing through.

This example lists properties of the the BetweenMemberOf predicate.

Get-TransportRulePredicate BetweenmemberOf | fl

The output (redundant information removed):

Addresses :
Addresses2 :
Name : BetweenMemberOf
Rank : 6
LinkedDisplayText : between members of <a id="BetweenMemberOf1">distribution list</a> and <a id="BetweenMemberOf2">distribution list</a>

The LinkedDisplayText is the predicate description you see on the Conditions page in the EMC rules wizard (see Figure 1). The properties required are enclosed in <a> and </a> tags in the LinkedDisplayText. The predicate requires 2 properties – Addresses and Addresses2. The parameter names for these properties (shown as the link ids) are called BetweenMemberOf1 and BetweenMemberOf2. The link text shown in EMC is distribution list for both properties - indicating the type of values required.


Figure 1: The LinkedDisplayText is the predicate description displayed in the EMC rules wizard. The two properties required for this predicate are called BetweenMemberOf1 and BetweenMemberOf2.

Ditto for all properties of an action. This example lists properties of the the RejectMessage action.

Get-TransportRuleAction RejectMessage | fl

The output:

RejectReason : Delivery not authorized, message refused
EnhancedStatusCode : 5.7.1
Name : RejectMessage
Rank : 14
LinkedDisplayText : send <a id="RejectMessageReasonText">rejection message</a> to sender with <a id ="RejectMessageEnhancedStatusCode">enhanced status code</a>

The RejectMessage action requires two properties - RejectReason and EnhancedStatusCode. The parameters are named RejectMessageReasonText and RejectMessageEnhancedStatusCode. The LinkedDisplayText is the action description shown on the Actions page in the rules wizard in EMC (see Figure 2). If a value isn't specified for the EnhancedStatusCode, the default value is 5.7.1.


Figure 2: The LinkedDisplayText is the action description displayed in the EMC rules wizard. The two properties required for this action are called RejectMessageReasonText and RejectMessageEnhancedStatusCode.

Let's create the same transport rule in Exchange 2010.

New-TransportRule -Name EthicalWall -BetweenMemberOf1 Brokers -BetweenMemberOf2 Bankers -RejectMessageReasonText "Members of Bankers and Brokers distribution groups are not allowed to send email to each other."

Yes, that's it - it's a one-liner!

Common Errors

The more common error you may make when creating rules is not specifying all parameters required for a predicate. For example, you may specify the BetweenMemberOf1 parameter, but not BetweenMemberOf2. Luckily, the shell provides some great to-the-point feedback in such cases.

When the BetweenMemberOf1 parameter is specified, the following parameters must also be specified: BetweenMemberOf2.
   + CategoryInfo : InvalidArgument: (BetweenMemberOf1:String) [New-TransportRule], ArgumentException
   + FullyQualifiedErrorId : 760A4623,Microsoft.Exchange.MessagingPolicies.Rules.Tasks.NewTransportRule

Another common error is specifying an incorrect value for a parameter, when the cmdlet expects a value from a fixed list of values. In this example, we've provided an incorrect value ("foo") for the ADComparisonAttribute parameter. In such cases, the shell lists all the correct values, as shown in the following example.

Cannot process argument transformation on parameter 'ADComparisonAttribute'. Cannot convert value "foo" to type "Microsoft.Exchange.MessagingPolicies.Rules.Tasks.ADAttribute" due to invalid enumeration values. Specify one of the following enumeration values and try again. The possible enumeration values are "DisplayName, FirstName, Initials, LastName, Office, PhoneNumber, OtherPhoneNumber, Email, Street, POBox, City, State, ZipCode, Country, UserLogonName, HomePhoneNumber, OtherHomePhoneNumber, PagerNumber, MobileNumber, FaxNumber, OtherFaxNumber, Notes, Title, Department, Company, Manager, CustomAttribute1, CustomAttribute2, CustomAttribute3, CustomAttribute4, CustomAttribute5, CustomAttribute6, CustomAttribute7, CustomAttribute8, CustomAttribute9, CustomAttribute10, CustomAttribute11, CustomAttribute12, CustomAttribute13, CustomAttribute14, CustomAttribute15".
   + CategoryInfo : InvalidData: (:) [New-TransportRule], ParameterBindin...mationException
   + FullyQualifiedErrorId : ParameterArgumentTransformationError,New-TransportRule


Figure 3: Certain properties require a value from a fixed set of values. In EMC, these can be selected from a drop-down list. If you specify an unexpected value when using the shell, a list of all correct values is provided.

View Transport Rules

The Get-TransportRule cmdlet retrieves a list of all transport rules. As a result of having all predicate and action properties available as parameters, when you use the Get-TransportRule cmdlet to view the properties of a transport rule (Get-TransportRule <rule name> | fl, where fl is short for the format-list cmdlet), you’ll see the large number of parameters scroll by rather quickly, making it difficult to determine which parameters are actually used for the cmdlet. This is a tradeoff we had to make when redesigning the cmdlet experience for transport rules.

However, there’s an easy workaround. Each rule has the Conditions and Actions properties which list the predicates and actions used. This example retrieves the rule conditions.

(Get-TransportRule EthicalWall).Conditions | fl

The output:

Addresses:{Brokers@contoso.com}
Addresses2 :{Bankers@contoso.com}
Name :BetweenMemberOf
Rank :6
LinkedDisplayText :between members of <a id="BetweenMemberOf1">distribution list</a> and <a id="BetweenMemberOf2">distribution list</a>

You can use (Get-TransportRule <rule name>).Exceptions to list all exceptions and (Get-TransportRule <rule name>).Actions to get a list of all actions specified in the rule. This example does not use any exceptions. The following output shows the actions:

RejectReason:Members of Bankers and Brokers distribution groups are not allowed to send email to each other.
EnhancedStatusCode:5.7.1
Name:RejectMessage
Rank:14
LinkedDisplayText:send <a id="RejectMessageReasonText">rejection message</a> to sender with <a id ="RejectMessageEnhancedStatusCode">enhanced status code</a>

Having all predicate properties and actions available as parameters also allows you to filter the rules based on these parameters. For example, to get a list of all transport rules where the Brokers distribution group is used in the BetweenMemberOf predicate:

Get-TransportRule | Where {$_.BetweenMemberOf1 -like "*Brokers*" -or $_.BetweenMemberOf2 -like "*Brokers*"}

Or you can list all transport rules that perform a particular action. This example lists all transport rules that use the RejectMessage action.

Get-TransportRule | Where {$_.RejectMessageReasonText -ne $null}

Modify a transport rule

Now you can use the Set-TransportRule cmdlet and modify the –BetweenMemberOf and/or –BetweenMemberOf2 parameters, and specify different distribution groups. You can also add additional predicates to the condition, or add exceptions. This example adds the additional predicate SubjectOrBodyContains so only messages that are sent between the two distribution groups AND with the word "trade" in the message subject or body are blocked by the rule.

Set-TransportRule EthicalWall -SubjectOrBodyContainsWords "trade"

If you decide not to use the BetweenMemberOf predicate, you can remove it by setting both its properties to $null.

Set-TransportRule EthicalWall –BetweenMemberOf1 $null –BetweenMemberOf2 $null

Note: If you don’t use any predicates or exceptions in a rule, the rule applies to all messages.

Enable, Disable and Remove Transport Rules

You can use the Enable-TransportRule and Disable-TransportRule cmdlets to enable or disable transport rules.

Enable-TransportRule EthicalWall

When disabling a transport rule using the Disable-TransportRule cmdlet, you’re greeted with a confirmation prompt. You can override the prompt using the –Confirm parameter.

Disable-TransportRule EthicalWall –Confirm:$false

This example disables all transport rules and overrides the confirmtaion prompt.

Get-TransportRule -State Enabled | Disable-TransportRule –Confirm:$false

Similarly, you can remove transport rules using the Remove-TransportRule cmdlet.

Change Transport Rule Priority

Tranpsort rules are executed by the rules agents on the Hub and Edge Transport servers based on their priority, in ascending order. The lowest priority value is 0, assigned to the first transport rule you create. For each successive rule you create, the priority is incremented by 1. You can change the priority of a rule to change the rule execution order. The priority values for other transport rules is adjusted (increased or decreased) depending on the new priority you assign to the rule you’re modifying.

For example, if you have 4 transport rules called EthicalWall1, EthicalWall2, EthicalWall3 and EthicalWall4, with the default priority assigned at creation (0 for EthicalWall1 and 3 for EthicalWall4). If you want to ensure the EthicalWall2 rule is executed last, you can use Set-TransportRule cmdlet to modify rule priority

Set-TransportRule EthicalWall2 -Priority 3

Remember, the highest priority is n-1, where n is the total number of rules. This also allows you to easily determine the total number of transport rules. Use Get-TransportRule | Select -Last 1. The total number of rules = priority of last rule + 1. Alternatively, you can use (Get-TransportRule).count.

Getting all parameters for a cmdlet

Here's a tip that many shell jockeys find useful. During Exchange 2007 development, I found myself frequently asking the same question— How can I list all the parameters for a cmdlet? Cmdlet help (Using Get-Help <Cmdlet Name> -Full or -Detail) would show me a lot of details, including the parameter name, type, description, examples, etc. — but I just need the list of all parameters! Cmdlet reference documentation has all this information, well-formatted and perhaps more readable than Shell output, but it requires firing up a browser window. Most shell jockeys would consider that inefficient! It wasn’t quite possible in Exchange 2007.

In Exchange 2010, you can get a list of parameters for any cmdlet using the following syntax.

(Get-Command <Cmdlet Name>).Parameters

For example, to get a list of all parameters for the New-TransportRule cmdlet:

(Get-Command New-TransportRule).Parameters

So, how many parameters does New-TransportRules cmdlet have? Use the following command to find out!

(Get-Command New-TransportRule).Parameters.Count

Bharat Suneja

Public Folder Replication Fails Due To Empty Legacy Administrative Group

$
0
0

EDIT 10/18/2010: Removed the reference to upcoming fix (no fix current planned).

Some customers are finding that when they try to replicate their public folder content to Exchange 2010, it will not replicate. Looking at the application log, you may find an event like this:

Log Name: Application
Source: MSExchange Store Driver
Event ID: 1020
Level: Error
Description:

The store driver couldnt deliver the public folder replication message "Hierarchy (PublicFolder@contoso.com)" because the following error occurred: The Active Directory user wasn't found.

This happens because we assume that if a Servers container exists, there will be a System Attendant object somewhere inside it. However, in an environment where Exchange 2000 or 2003 previously existed, and all those servers have been removed, you probably have a First Administrative Group or some other Administrative Group still hanging around with a Servers container, but no servers inside it. When the Exchange 2010 Store Driver stumbles across this empty Servers container, this error is the result.

To work around the issue, get rid of that empty Servers container. Exchange System Manager won't let you delete it, but you can use the ADSI Edit tool to remove it. Just be sure that the Servers container you are deleting is one that has nothing in it!

This workaround invariably brings up the question: Can't we just delete the old Administrative Group since we don't need it anymore? After all, Exchange System Manager will let you gracefully delete an Administrative Group. The answer to that is a little more involved.

The current documentation on TechNet strongly recommends against deleting old admin groups, and it states that if you do, and you see mail backing up in the System Attendant mailbox, you must then use ADModify to change the legacyExchangeDN on all your users from the old admin group. However, this is not entirely true, and that documentation is being changed.

Items stuck in the System Attendant mailbox

The System Attendant is responsible for publishing free/busy messages to public folders for certain clients such as OWA. When it can't publish these items to the appropriate free/busy public folder, the items stay in the System Attendant mailbox until the problem is corrected.

The most common cause of this problem is that there is simply no replica of the free/busy folder for a given admin group, which usually happens when the public folder stores for that admin group have been ungracefully removed (such as deleted through ADSI Edit) without properly replicating all the content off. This actually has nothing to do with the removal of the admin group itself, but rather with the removal of the public stores in that admin group.

Fortunately, this problem is easy to correct. Forcibly deleting all the public stores in an admin group does not delete the free/busy folder from the hierarchy - it just means all the replicas are gone. To correct this, you can use your public folder admin tool of choice to navigate to the System Folders and find the free/busy folder in question. Then, just add a replica of that folder to a public store in some other admin group. After allowing time for replication, the System Attendant mailbox should clear.

The important point here is that mail backing up in the System Attendant mailbox is not a reason to change the legacyExchangeDN on the users from that old admin group. Just add a replica, and you should be good to go.

A missing free/busy folder

Removing a legacy admin group does not typically cause a problem. However, there is a possible situation to be aware of.

Every admin group has a siteFolderServer attribute. This attribute points to the public folder store that is responsible for the free/busy folder for that admin group. Most of the time, that public folder store doesn't have to do anything, but it is responsible for making sure that the free/busy folder exists. If the free/busy folder for that admin group is missing, it's up to that public folder store to create it.

You can't delete the free/busy folder through any admin tool (ESM, the cmdlets, etc, won't let you), or even through something like ADSI Edit - it's an object in the store, not in the Active Directory. However, it is theoretically possible that somehow, that folder could go missing. If you deleted all your public folder databases and started over with clean ones, or something else unusual happened, you could end up in a situation where there is no free/busy folder for a particular legacy admin group. If that legacy admin group no longer exists in the directory, and thus has no siteFolderServer specified, then the free/busy folder will not get recreated, and you'll see items backing up in the System Attendant.

Even in this situation, there's a fairly easy way to fix the problem. If you still have Exchange System Manager, you can use it to recreate the legacy admin group. Alternately, you can use ADSI Edit to do the same. The important thing is to make sure the legacyExchangeDN is correct - make sure it matches the legacyExchangeDN on the users that were created in that old admin group. On the new admin group object, make sure you have a siteFolderServer that points to an existing public store in some other admin group. Within 24 hours, the free/busy folder for that admin group will get recreated.

If you don't want to recreate the admin group, then your other option at this point is to change the legacyExchangeDN on the users from that admin group. The steps for this are still documented in TechNet.

Our recommendation

We recommend you leave the old admin groups around, simply because there's no reason to remove them. Also, it's possible your free/busy folder could go missing at some point, and then you either have to recreate the admin group or change the legacyExchangeDN on the users.

If you decide to remove an admin group anyway, you should always do it through Exchange System Manager, which will prevent you from deleting it if it still contains objects you need - like the public folder hierarchy object. Deleting the admin group while it still contains the hierarchy object will completely break public folder replication and your ability to administer the folders, among other things.

For these reasons, our recommended workaround for the public folder replication issue is to delete the empty Servers container using ADSI Edit. But technically, yes, you could delete the admin group - gracefully from ESM - to achieve the same end. This doesn't usually cause a problem, and situations where you have to change the legacyExchangeDN of the users should be pretty rare.

- Bill Long

Patching the Multi-Role Server DAG

$
0
0

One of the things about Exchange 2010 that many of my customers find very attractive (and I have to agree with them) is the idea of the multi-role or “all-in-one” DAG server. This means having all three of the core Exchange 2010 roles installed on all of the servers in the DAG – Mailbox, Hub Transport and Client Access. There are a lot of reasons why this is an attractive solution, but here are a few of the main ones:

  • All servers in the Exchange environment (discounting Unified Messaging and Edge) are exactly the same – same hardware, same configuration, etc. This simplifies ordering the hardware, maintenance and management of the servers.
  • In many cases you end up with less Exchange servers in the environment. This is interesting because usually the operational expenditure is higher than the capital expenditure, meaning that it costs more to run a server than it did to purchase it in the first place.
  • Less servers means that you also have less of some other things – a sort of “trickle down” effect. For instance, you might have a lower number of network switch ports needed, and for large customers this could be significant. Or maybe you need less physical space for these servers, and for some customers, space is a significant issue.
  • The idea of “all roles on one server” allows you to take full advantage of the new hardware capabilities out there today. As part of the design, you want to ensure you utilize as much of the hardware as possible to drive down the cost/mailbox; the latest hardware is quite fast from a megacycle perspective, which means you are either increasing the scale on the server in terms of the number of mailboxes, virtualizing or deploying multiple roles.  For the multi-role server, Microsoft supports up to 24-cores – that is a 4-socket, 6-cores per socket server. Granted, this is only useful for larger customers, but for those larger customers it can be quite important!

But, when talking about these multi-role solutions, I always make sure to let my customers know that this is a starting point. There are no technical reasons why having the roles combined like this is “better” than having the roles separated. Exchange 2007 didn’t support CAS and HT on clustered servers, and we took a lot of customer feedback to help us decide that we needed to support that in Exchange 2010. That doesn’t mean that it is better, it means that it is another option, and if it is right for your environment, then great! If not, well, having separate CAS/HT servers (or separate CAS and separate HT servers) is fully supported and is still a valid solution model.

In fact, there are a couple of things that you need to carefully consider before deciding that the multi-role server is right for you. First is the idea that by putting your CAS role on the DAG member servers, you are forcing yourself to require a hardware load balancer (or third party software load balancer). The DAG still leverages Windows Failover Clustering as a container that defines the boundaries of the DAG and to help the DAG determine whether quorum can be met (amongst other things). When you combine that fact with the idea that you cannot have Windows Load Balancing Services loaded on a server that also has Windows Failover Clustering loaded, you are forced to find another solution for load balancing. For smaller customers, or for branch office scenarios, this might be a deal-breaker. There are some less expensive hardware load-balancing solutions out there, but for some customers, even those might be too expensive, which means that this multi-role server idea won’t work.

Another thing to consider as you determine the architecture you want to utilize for your Exchange 2010 environment is how you will patch your highly available servers. You don’t deploy a DAG unless you really need mailbox resiliency within the datacenter and/or between physical locations – it is a very expensive way to deploy Exchange 2010 if your requirements don’t drive you to need mailbox resiliency! So, if you are spending that money, you need to make sure you understand how to patch these servers and provide the highest level of availability possible.

As you think about these multi-role solutions, also remember the fact that all of the Client Access role servers will be identified as part of the CAS array in a given Active Directory site (this is automatic). When you configure your hardware load balancers, you will need to add all of these Client Access servers into the load-balanced array to allow them to actually be utilized for client access. But, if you’ve done that, how do you patch your servers? If you patch one of the servers (for ease of writing, let’s assume RTM to RU1) and add it back into the array, you now have the possibility a Client Access server at RTM (one of the un-patched servers) fronting a mailbox on RU1 (the newly patched server)! Not good – we all know that you patch these servers in alphabetical order – CAS, HT, MBX – and that means you aren’t supposed to have the mailbox at a newer build than the Client Access server!

So, what do you do about that? We’ll look at some scenarios in the rest of this article, and talk at a high level about the process you’ll take to ensure that you don’t get into a situation where your mailbox is at a newer build than the CAS in front of it.

All of the scenarios below have the patching impact that you will have to manipulate your load-balanced array every time you patch your servers. This possibly means coordinating with another team and putting some management load on them. Of course, any time you patch a CAS array, you’ll probably need to interface with the load-balancer team anyway – you need to “drain stop” each individual CAS server as you patch it anyway to keep the client disconnects and reconnects as low as possible. So, really, this might add a little management overhead to the load-balancer team, but it is possible that it isn’t a significantly high amount of additional work.

The only way you can balance this “additional work” for the load-balancer owners is the fact that HA costs money. You have to remember that. The higher you want your availability to be, the more it costs. Whether it is you or one of your customers, this core tenet of HA must be kept in mind. The other option is to just say that your maintenance window is a time when taking email services completely down is acceptable. But, then again, if you’re spending all this money on HA, is that really an option?

Patching Scenario – Small Office / Branch Office

This is the simplest DAG architecture out there. We’re talking about a single DAG in a single location with only 2 or 3 servers. This is for HA only – no site resilience. For our example here, we’ll look at a 3-member DAG – see this simple diagram:

How do we patch this DAG? Here are a few steps:

  1. As is always necessary when moving databases around on your DAG, ensure that your replication is healthy and all copies are up to date.  For the purposes of this example, we’ll start the upgrade process with Server 3.
  2. Activation block Server 3 so that a failure at this time won’t activate copies of the mailbox databases on that server.
  3. Perform a switchover of all databases away from Server 3 to Server 1 and Server 2.
  4. Drain-stop all connections to the CAS on Server 3, and then remove it from the load-balanced array (note that we do not remove the server from the CAS Array) and patch it.
  5. Add Server 3 back into the load-balanced array, drain-stop Server 1 and Server 2 and remove them from the load-balanced array.
    1. Notice that for a short period, we have both upgraded and not-upgraded servers in the load-balanced array. This is not an issue, because we still have all mailboxes on the not-upgraded mailbox servers.
  6. Remove the activation block on Server 3, activation block Server 2, perform the switchover of all databases from Server 2 to Server 1 and Server 3, patch Server 2 and add it back into the load-balanced array.
  7. Remove the activation block on Server 2, activation block Server 1, perform the switchover of all databases from Server 1 to Server 2 and Server 3, patch Server 1 and add it back into the load-balanced array.
  8. Remove the activation block on Server 1, and redistribute your databases evenly across all three servers (Note that there will be a pretty sweet script in Exchange 2010 Service Pack 1 to do this for you!).

Impact(s) of this process:

  • At that time when you have patched a single server and you have the entire load-balanced array pointing at that one server (in our example above, when Server 3 has been added into the load-balanced array and Servers 1 and 2 have been removed from the load-balanced array), you have no HA on your CAS services. This makes the assumption that at the time of patching, that one CAS server can handle the load sufficiently. Until you have patched your second server and added it into the load-balanced array, you could have a service interruption by the failure of that one server.
    • Remember that this is only for the time period that you have not patched that second server and added it back into the load-balanced array.
    • Also remember that under normal conditions, this process will cause less interruption of service than taking the entire system offline for the time that we need to patch the 2 or 3 servers – so in most instances you will be at a higher level of availability than you would be if you didn’t follow this procedure.
  • You should also keep in mind that during this patching process, you cannot take two servers offline at the same time – a three member DAG (as shown in our example) will lose quorum when you take two members down, and all email services will be unavailable in that case.

Patching Scenario – Medium Sized Deployment

This is a slightly larger environment – a single DAG with 4 or more servers in the DAG, all located in one location. Let’s use a 6-member DAG for our example this time. Refer to this diagram for this example:

Also note that for this example, we’re going to say that we have designed this DAG to support two concurrent failures. This means that if we take two servers out of actively hosting mailboxes for patching, by having three copies of all databases, we are assured that we can continue to provide email services. It is possible to modify this solution to only take a single server out of service at a given time, and that is a perfectly acceptable solution – this is just an example presented here for discussion.

  1. Ensure that your replication is healthy and all copies are up to date.
  2. In our example we are going to patch two servers at a time, starting with Server 5 and Server 6. 
  3. Activation block Server 5 and Server 6 so that a failure at this time won’t activate copies of the mailbox databases on those servers.
  4. Perform a switchover of all databases away from Server 5 and Server 6 to the other four servers in the DAG.
  5. Drain-stop all connections to the CAS on Server 5 and Server 6, and then remove them from the load-balanced array
  6. Patch Server 5 and Server 6.
  7. Add Server 5 and Server 6 back into the load-balanced array, drain-stop all other servers and remove them from the load-balanced array.
    1. Notice that for a short period, we have both upgraded and not-upgraded servers in the load-balanced array. This is not an issue, because we still have all mailboxes on the not-upgraded mailbox servers.
  8. Remove activation block from Server 5 and Server 6, activation block Server 3 and Server 4, perform the switchover of all databases from Server 3 and Server 4 to the other four servers, patch Server 3 and Server 4 and add them back into the load-balanced array.
  9. Remove activation block from Server 3 and Server 4, activation block Server 1 and Server 2, perform the switchover of all databases from Server 1 and Server 2 to the other four servers, patch Server 1 and server 2 and add them back into the load-balanced array.
  10. Remove activation block from Server 1 and Server 2, and redistribute your databases evenly across all three servers.

Impact(s) of this process:

  • For a period of time, you will be running with a possibly lower availability stance than normal operating conditions. You only have 2 servers providing CAS services until you have patched those other servers and added them back into the load-balanced array. (If you only have 4 servers in the DAG, this might not be the case.)
  • In the case where you have very high numbers of users in this physical location, it is possible that you would introduce a performance impact on CAS services, because of the reduced number of Client Access servers in service.
    • Think about the situation where you have 8 or 10 servers in the DAG in this physical location, and you have only patched 2 servers. In that case, those 2 servers could probably not handle the load of all users under full production load. But, you typically won’t be patching during a “full production” time of the day – you’ll have a maintenance window that you will be working in, and users will know to have a lower expectation of availability and such. As long as you understand this and are willing to accept this risk, this is fine, but you should almost certainly make sure that you document this case and make sure that it really is acceptable!
    • The other way to think about this is to make sure that the two servers you bring back into the load-balanced array have enough processing power and memory to support the entire load. This is probably the best engineering solution for a highly available Exchange 2010 environment, but it does have a cost associated with it just like everything else in HA. If I were going to recommend a solution, this is how I would recommend it – make sure you have enough processing that if you end up in a production environment on two upgraded servers, that they can handle your full production peak load.

Patching Scenario – Large Deployment

Multiple DAGs, multiple servers in each DAG, DAGs spread across multiple locations. Think about the scenario where you have two datacenters with two DAGs of 12 servers each, and users active in both datacenters. At any given time, you have 6 servers in a passive mode in each of the two datacenters. This is for big customers – a lot of my customers are very large, and I’m working with three customers right now: 120K mailboxes, 250K mailboxes and 600K mailboxes.

To help define this environment, here is a relatively simple diagram of two DAGs showing the replication data flow direction.

Now, how to patch this beast… This example will discuss patching the West Datacenter servers – just repeat this process for the East Datacenter after completing the West Datacenter upgrades.

  1. Ensure that all replication is healthy and all copies are up to date on both DAGs.
  2. Activation block all of the DAG2 servers in the West Datacenter to keep databases from failing over to these servers.
  3. Ensure no databases from DAG2 are active in the West Datacenter. If so, perform the switchovers necessary to move those databases back to the East Datacenter and ensure that all replication comes back healthy and all copies come up to date.
  4. In the West Datacenter only, drain-stop all of the servers in DAG2 and remove those servers from the West Datacenter load-balanced array.
  5. Patch all DAG2 servers in the West Datacenter.
  6. Add all DAG2 servers in the West Datacenter back into the load-balanced array and remove the activation block on those servers.
  7. Drain-stop all DAG1 servers in the West Datacenter and remove them from the West Datacenter load-balanced array.
  8. Work through the DAG1 servers patching them “two by two”. This means to move active mailboxes off the servers two at a time, patch those two servers, move databases off of two more servers, and patch. This would probably look like this (assuming you had 6 servers from DAG1 in the West Datacenter):
    1. In our example we are going to patch two servers at a time, starting with Server 5 and Server 6 (of DAG1 in the West Datacenter).  Activation block Server 5 and Server 6 so that a failure at this time won’t activate copies of the mailbox databases on those servers.
    2. Perform a switchover of all databases away from Server 5 and Server 6 to the other four West Datacenter servers in DAG1.
    3. Patch Server 5 and Server 6.
    4. Remove activation block from Server 5 and Server 6, activation block Server 3 and Server 4, perform the switchover of all databases from Server 3 and Server 4 to the other four servers in the West Datacenter, and patch Server 3 and Server 4.
    5. Remove activation block from Server 3 and Server 4, activation block Server 1 and Server 2, perform the switchover of all databases from Server 1 and Server 2 to the other four servers in the West Datacenter, and patch Server 1 and server 2.
    6. Remove activation block from Server 1 and Server 2, and redistribute your databases evenly across all of the DAG1 West Datacenter servers.
  9. Once you have patched all servers from DAG1 in the West Datacenter and evenly distributed your databases, you can then add all of the West Datacenter DAG1 servers back into the West Datacenter load-balanced array, completing the patch of the West Datacenter Exchange servers.

Impact(s) of this process:

  • While you are patching, it is probable that your site resilience stance will be lower. Think about the scenario where you have a datacenter failure while the servers in the other datacenter are in the process of being patched. If half of your servers have been patched, then this could cause a performance issue in the case where the “passive” datacenter needs to be activated, or it could add time to the activation process while other server patches are completed.

Conclusion

Most of this isn’t “rocket science” – it is just something to think about. We have to be aware that in some instances, especially in those very small environments (small orgs or branch offices), we might want to look at another solution such as virtualizing the whole thing and using Windows NLB instead of using the multi-role servers. This goes back to one of the first things I said – it is all driven by the requirements. If you don’t need mailbox resiliency, don’t deploy a DAG. If your requirements drive you away from the multi-role server, don’t hesitate to go with roles broken out onto separate servers. Just make sure that you make these decisions with your eyes open – understand the implications of everything right down to how you will patch these servers once they have been deployed!

- Robert Gillies

EMC and certificates with failed revocation checks in Exchange 2010

$
0
0

Starting with Exchange Server 2007, we added protection for Exchange data paths to Client Access Servers using SSL. SMTP communication between transport servers is also protected using TLS. To ensure this protection is enabled out-of-the-box, Exchange setup creates self-signed certificates and enables SSL and TLS by default. For external communication, we recommend that you procure certificates signed by a Certification Authority (CA) that is trusted by clients.

In Exchange 2010, we introduced new certificate management interfaces in the Exchange Management Console (EMC). Using the new certificate wizards in EMC, you can:

The status of a certificate that’s displayed in EMC is returned by the Get-ExchangeCertificate cmdlet. For CA-signed certificates, the certificate’s revocation status is checked in the Certificate Revocation List (CRL) published by the CA.

If Exchange can’t access the CRL, the certificate status is returned as RevocationCheckFailure by the shell. In EMC this is displayed as The certificate status could not be determined because the revocation check failed.

Screenshot: Status of certificate with revocation check failed
Figure 1: The status of a certificate with a failed certificate revockation check is displayed as 'The certificate status could not be determined because the revocation check failed.'

This can occur due to a number of reasons, for example:

  • Transient network connectivity failure or Internet outage
  • Network or proxy misconfiguration, or a firewall rule preventing Internet access
  • Intentional blocking of Internet connectivity from the server
  • Failure of CRL server
  • Issues with CA certificate

A failure to check certificate revocation status is different from a revoked certificate, where the CRL published by the CA has been checked and the certificate found to be revoked. For revoked certificates, the certificate status is explicitly returned as revoked.

Revoked certificate status in EMC
Figure 2: The status of a revoked certificate is displayed as 'This certificate is invalid for Exchange Server usage.'

Screenshot: Revoked certificate properties
Figure 3: Certificate properties of a revoked certificate indicate the certificate has been revoked

When a certificate fails a revocation check due to any of the above reasons, the EMC prevents you from assigning the certificate to any Exchange service. Note, this does not impact certificates that have already been assigned to Exchange services. The services will continue to function.

If the failure is due to a transient condition, you can retry when the server has Internet connectivity and can access the CRL. If it’s caused by network misconfiguration, you can retry after the issue has been resolved and Internet connectivity restored.

If you need to enable the certificate that’s in the RevocationCheckFailure status, you can use the Enable-ExchangeCertificate cmdlet from the shell. The EMC is more restrictive in how it treats certificates with a failed revocation check. It errs on the side of caution to prevent a revoked certificate from being assigned to a service, and thus impacting service.

We’ve received feedback from customers that you would like to be warned about a revocation check failure for a certificate, but still be able to assign the certificate to Exchange services from EMC. We’re considering the change in EMC behavior for a future release.

Bharat Suneja

Released: Software Update 1 for ForeFront Threat Management Gateway (TMG) 2010 Service Pack 1

Removing specific messages from your Exchange Server

$
0
0
Ever so often, an Exchange administrator faces a situation where messages that fit specific criteria need to be removed from a large number of mailboxes or from Exchange transport queues. The need may arise due to some sort of mass mailing, a message sent accidentally to a large distribution group or individual recipients, or it could be one of the steps required to be taken as a part of cleanup efforts after a mass-mailing virus outbreak (although the latter have been increasingly rare and generally taken care of by Exchange-aware antivirus scanners).

The steps for accomplishing this are documented in various places in Exchange documentation, but it can be difficult to refer to multiple sources if you have a mixed environment containing several versions of Exchange Server. We wanted to provide a single place with somewhat generic instructions on how to accomplish these tasks across all currently supported versions of Exchange Server - Exchange 2010, Exchange 2007, and Exchange 2003.

Removing messages from mailboxes

Removing messages using the Shell in Exchange 2010 RTM and Exchange 2007

In Exchange 2010 RTM and Exchange 2007, you can use the Export-Mailbox cmdlet to export or delete messages. In Exchange 2010 SP1, the functionality to export a mailbox is provided by the New-MailboxExportRequest cmdlet and is covered in a separate article. The functionality to search and delete messages is provided by the Search-Mailbox cmdlet.

Permissions

In Exchange 2010, the Mailbox Export ImportRBAC role must be assigned to the account used to perform this operation (using Export-Mailbox in Exchange 2010 RTM or Search-Mailbox in Exchange 2010 SP1). If the role isn't assigned, you'll be unable to run or "see" the cmdlet.

The versatile Export-Mailbox cmdlet can export mailbox content based on specific folder names, date and time range, attachment file names, and many other filters. A narrow search will go a long way in preventing accidental deletion of legitimate mail. For more details, syntax and parmeter descriptions, see the following topics:

The account used to export the data must be an Exchange Server Administrator, a member of the local Administrators group of the target server, and have Full Access mailbox permission assigned on the source and target mailboxes. The target mailbox you specify must already be created; the target folder you specify is created in the target mailbox when the command runs.

Adding and removing the necessary permissions

This example retrieves all mailboxes from an Exchange organization and assigns the Full Access mailbox permission to the MyAdmin account. You must run this before exporting or deleting messages from user mailboxes. Note, if you need to export or delete messages only from a few mailboxes, you can use the Get-Mailbox cmdlet with appropriate filters, or specify each source mailbox.

Get-Mailbox -ResultSize unlimited | Add-MailboxPermission -User MyAdmin -AccessRights FullAccess -InheritanceType all

After exporting or deleting messages from mailboxes, you can remove the Full Access mailbox permission, as shown in this example:

Get-Mailbox -ResultSize unlimited | Remove-MailboxPermission -User MyAdmin -AccessRights FullAccess -InheritanceType all

Removing messages

Here are a few examples that remove messages.

This example removes all messages with the subject keyword "Friday Party" and received between Sept 7 and Sept 9 from the Inbox folder of mailboxes on Server1. The messages will be deleted from the mailboxes and copied to the folder DeleteMsgs of the MyBackupMailbox mailbox. The Administrator can now review these items or delete them from the MyBackupMailbox mailbox. The StartDate and EndDate parameters must match the date format setting on the server, whether it is mm-dd-yyyy or dd-mm-yyyy.

Get-Mailbox -Server Server1 -ResultSize Unlimited | Export-Mailbox -SubjectKeywords "Friday Party" -IncludeFolders "\Inbox" -StartDate "09/07/2010" -EndDate "09/09/2010" -DeleteContent -TargetMailbox MyBackupMailbox -TargetFolder DeleteMsgs -Confirm:$false

This example removes all messages that contain the words "Friday Party" in the body or subject from all mailboxes.

Depending on the size of your environment, it is better to do the extraction/deletion in batches by using the Get-Mailbox cmdlet with the Server or Database parameters (Get-Mailbox -Server servername -ResultSize Unlimited or Get-Mailbox -Database DB_Name -ResultSize Unlimited), or specifying a filter using the Filter parameter. You can also use the Get-DistributionGroupMember cmdlet to perform this operation on members of a distribution group.

Get-Mailbox -ResultSize Unlimited | Export-Mailbox -ContentKeywords "Friday Party" -TargetMailbox MyBackupMailbox -TargetFolder 'Friday Party' -DeleteContent

It is recommended to always use a target mailbox (by specifying the TargetMailbox and TargetFolder parameters) so you have a copy of the data. You can review messages before purging them so any legitimate mail returned by the filter can be imported back to its owner mailbox. However, it is possible to outright delete all messages without temporarily copying them to a holding mailbox.

This example deletes all messages that contain the string "Friday Party" in the message body or subject, without copying them to a target mailbox.

Get-Mailbox | Export-Mailbox -ContentKeywords "Friday Party" -DeleteContent

Removing messages on Exchange 2003 and Exchange 2000 using ExMerge

The ExMerge utility can be used to extract mail items from mailboxes located on legacy Exchange Server versions. Follow the steps in KB 328202 HOW TO: Remove a Virus-Infected Message from Mailboxes by Using the ExMerge.exe Tool to remove unwanted messages from user mailboxes.

Removing messages from Public Folders

You can use the Outlook Object Model to remove messages from Public Folders. This works on any version of Exchange. The down side is that it's slower and may stumble when it hits huge folders with tens of thousands of items. In Exchange 2010/2007, you can use Exchange Web Services to remove messages from Public Folders. EWS has no problem running against large folders.

The following posts have more details:

Removing messages from mail queues

There may be times where you need to purge messages from Exchange Server's mail queues to prevent delivery of unwanted mail. For more details about mail queues, see Understanding Transport Queues.

Removing messages from mail queues on Exchange 2010 RTM and Exchange 2007

Removing a message from the queue is a two-step process. The first thing that must be done is that the message itself must be suspended. Once the messages have been suspended then you can precede with removing them from the queue. The below commands are based on suspending and removing messages based on the Subject of the message.

Exchange 2007 SP1 and SP2

This command suspends messages with the string "Friday Party" from transport queues on all Hub Transport servers in your Exchange organization:

Get-TransportServer | Get-Queue | Get-Message -ResultSize unlimited | where{$_.Subject -eq "Friday Party" -and $_.Queue -notlike "*\Submission*"} | Suspend-Message

On Exchange 2007 RTM to SP2, you will not be able to suspend or remove message that are held in the Submission queue. So the command will not run against the messages in the submission queue.

This command removes all suspended messages from queues other than the Submission queue.

Get-TransportServer | Get-Queue | Get-Message -ResultSize unlimited | where{$_.status -eq "suspended" -and $_.Queue -notlike "*\Submission*"} | Remove-Message -WithNDR $False

Exchange 2010 and Exchange 2007 SP3

This command suspends messages that have the string "Friday Party" in the message subject in all queues on Hub Tranpsort servers.

Get-TransportServer | Get-Queue | Get-Message -ResultSize unlimited | where {$_.Subject -eq "Friday Party"} | Suspend-Message

This command removes messages that have the string "Friday Party" in the message subject in all queues on Hub Transport servers:

Get-TransportServer | Get-Queue | Get-Message -ResultSize unlimited | Where {$_.Subject -eq "Friday Party"} | Remove-Message -WithNDR $False

Note, you can run the command against an individual Hub Transport server by specifiying the server name after Get-TransportServer.

Suspend and remove messages from a specified transport queue

You can also suspend and remove messages from a specified queue. To retrieve a list of queues on a transport server, use the Get-Queue cmdlet.

This example suspends messages with the string "Friday Party" in the message subject in a specified queue.

Get-Message -Queue "server\queue" -ResultSize unlimited | where{$_.Subject -eq "Friday Party"} | Suspend-Message

This example removes messages with the string "Friday Party" in the message subject in the specified queue.

Get-Message -Queue "server\queue" -ResultSize unlimited | where{$_.Subject -eq "Friday Party" } | Remove-Message -WithNDR $False

Clear queues in Exchange Server 2000 and Exchange Server 2003 with MFCMAPI

In Exchange 2003/2000, you can use MFCMapi to clear the queues. For details, see KB 906557 How to use the Mfcmapi.exe utility to view and work with messages in the SMTP TempTables in Exchange 2000 Server and in Exchange Server 2003.

If there are a large number of messages in the queue, you may want to limit how many are displayed at a time. From the tool bar select Other > Options and under Throttle Level change the value to a more manageable number (for example, 1000).

Preventing message delivery using Transport Rules

In Exchange 2010 and Exchange 2007, you can use Transport Rules to inspect messages in the transport pipeline and take the necessary actions, such as deleting a message, based on the specified criteria. See Understanding Transport Rules for more details.

On Exchange 2010 and Exchange 2007, you can use the New Transport Rule wizard from the EMC to easily create transport rules. The following examples illustrate how to accomplish this using the Shell. Note the variation in sytnax between the two versions. (The Exchange 2010 transport rule cmdlets have been simplified, allowing you to create or modify a transport rule using a one-line command.)

Creating a Transport Rule to delete messages in Exchange 2010

This example creates a transport rule to delete messages that contain the string "Friday Party" in the message subject.

New-TransportRule -Name "purge Friday Party messages" -Priority '0' -Enabled $true -SubjectContainsWords 'Friday Party' -DeleteMessage $true

Creating a Transport Rule to delete messages in Exchange 2007

This example creates a transport rule to delete messages that contain the string "Friday Party" in the message subject.

$condition = Get-TransportRulePredicate SubjectContains
$condition.Words = @("Friday Party")
$action = Get-TransportRuleAction DeleteMessage
New-TransportRule -name "purge Friday Party messages" -Conditions @($condition) -Actions @($action) -Priority 0

Note: If your Exchange Organization has mixed Exchange 2007 and Exchange 2010 you will have to create a rule for each Exchange version.

Angelique Conde, Ed Bringas

ExRCA: Now supporting 10 additional languages

$
0
0

Last year, we announced the Exchange Remote Connectivity Analyzer and usage continues to grow as people become aware of this web site. Today, we are releasing a new version which will help us reach an even wider audience... We now support 10 additional languages! Here is the list of all the languages we support:

  • Chinese (Traditional)
  • Chinese (Simplified)
  • English
  • French
  • German
  • Italian
  • Japanese
  • Korean
  • Portuguese
  • Russian
  • Spanish

To view these languages, you will need to modify the language preference in your browser. To modify the language in Internet Explorer, complete the following steps.

  1. Click the Tools button, and then click Internet Options.
  2. Click the General tab, and then click Languages.
  3. In the Language Preference dialog box, click Add.
  4. In the Add Language dialog box, select a language from the list, and then click OK. In this example, we've added French:

     
  5. Click OK twice.

Now, when you visit https://www.testexchangeconnectivity.com, you'll see the site in French, as shown in the following screenshot:

We hope the world wide community likes this new feature!

Tip for everyone: Tired of typing the full URL (www.testexchangeconnectivity.com) every time? Just enter exrca.com in your browser and you'll be redirected to the longer URL. :)

Known issues

The Exchange ActiveSync (EAS) tests allow you to select the Ignore trusts for SSL option. Checking this option only tells the tool to not fail if the certificate you are using is not in the list of Trusted Root Certificates. For example, this is useful if you're using a certificate from your own Windows CA. However, it will not allow the test to be completed over a non-SSL connection. If you don't have a certificate and want to test whether EAS works without SSL (over TCP port 80), this tool can't perform this validation. We will not be able to add this feature in the future. Note: Due to limitations in the RPCAPI, we are currently unable to ignore the certificate trust requirement for SSL for Outlook Anywhere/RPC over HTTP tests. We are looking into alternatives for future releases.

Share your story

Please keep the feedback coming! We love getting email letting us know when the tool helps make you successful. The Feedback link is in the footer of each page on the site. This goes directly to Brad and me.

Here's a short 50 second video I did with my daughter talking about the tool. Enjoy!

Shawn McGrath, Brad Hughes


Everything you wanted to know about read receipts and delivery reports but were (understandably) afraid to ask

$
0
0

A question that comes up often enough to merit a post is: "How does one block read receipts from leaving or entering my org?"

Good question. I'm glad you asked!

And to answer that we need to go into the way back machine to Exchange 2003.

In Exchange 2003 we used the IIS SMTP engine. As you know all the relevant settings were kept in the IIS metabase (taken from AD during the DS2MB 1 way process or natively there) so when it was requested that the ability to block read receipts be put into the product we obliged with a hotfix that allowed the creation of a key in the metabase to block these (after it was discovered that checking off "Do not send delivery reports" on the remote domain object did not accomplish this. More on that later.)

You can read about this in all its glory here.

While you are reading that you may notice the first sentence which mentions how editing the Remote Domain "Do not send delivery reports" will NOT block read receipts from entering/leaving your org (told you we'd come back to that).

Without getting too much into RFCs, a read receipt is not a delivery report. A delivery report is defined in RFC 1891. The mime content type of a delivery report is a multipart/report; report-type=delivery-status.

Actual shot of a delivery report below:

A read receipt is defined in RFC 2298 and has a mime content type of multipart/report; report-type=disposition-notification.

Actual read receipt found in the wild below:

A further thing to note is that delivery reports originate from the system administrator or postmaster or Microsoft Exchange Recipient account (depending on which version of Exchange we are talking about) while Read Receipts come from the recipient that has requested a receipt.

Still with me? Ok so if we circle back to the original Exchange 2003 kb it should be noted that those instructions only prevent INCOMING read receipts from entering your org. They do NOT stop internal users from sending read receipts to each other or from requesting read receipts of external users.

What adding that key to the metabase actually accomplishes is stripping of the Disposition-Notification-To mime header from incoming read receipt requests.

Read that again: read receipt REQUESTS.

Going back to the RFCs (I'll be quick I promise) there is a difference between the actual read receipt itself and the read receipt request (same goes for delivery reports and the initial delivery report request).

A read receipt request contains a Disposition-Notification-To header like the one below:

This is an important distinction as it is the read receipt request that causes the receiver to generate a Read Receipt.

This is what causes the receiver of the request to see this pop-up in Outlook:

If we strip that header the receiver is never prompted for a Read Receipt and thus never generates one.

Doing this for incoming messages is easy in Exchange 2003 since it is just a mime header we can strip.

Outgoing is not possible as the header is now a tnef MAPI property and part of the message structure.

Stopping outgoing read receipt requests requires a much greater code change investment and ultimately was never possible in exchange 2003 (for the curious and for completeness sake - a delivery report also has a corresponding delivery report request which is identified by the NOTIFY=SUCESS,FAILURE,DELAY parameters after a RCPT TO:. However unchecking "Allow Delivery Reports" on the remote domain object effectively blocks all Delivery Reports from coming out.)

Enter Exchange 2007. Yippee!

With Exchange 2007 we now have transport rules so we can totally block Read Receipts from leaving and entering, right?

Well, sort of.

For incoming read receipt requests we can create a transport rule to strip the Disposition-Notification-To header. Such a rule might look like this:

For outgoing Read Receipt requests we fall into a new twist on the Exchange 2003 issue.

Certain properties of an outgoing internally originated message are kept in a special x-header called X-ExtendedProps and you guessed it, Read Receipt request information is one of them.

This is a "pesudo-base64" encoded header that Exchange hub transport servers stamp on internal messages and which gets stripped out later by header firewall.

You can see this header by suspending the submission queue on a hub and export one of the suspended messages in there.

You will see something like this:

I'd like to pause here for a brief break and say that you will not see this header if you do a pipeline trace. It will only be visible if you export the message from the queue. The reason for this is that due to certain issues with custom transport agents in Exchange 2007 SP 1 we moved the content conversion stage further down the transport pipeline in Categorizer so a pipeline trace will only show you the state of a message PRE-conversion.

Ok, break over.

Since we have all the Read Receipt request info in this X-ExtendedProps header having a rule strip the Disposition-Notification-To header will have no effect. And transport rules cannot act on the system X-header (and even if they could very bad things may happen if you try to strip them. Just sayin').

Really the best way to strip outgoing Read Receipt requests is to stand up an Edge Transport server and have the identical rule above as an Edge rule. As stated earlier, once the message leaves the org Header Firewall will strip the X-header and replace it (in our case) with the standard RFC Disposition-Notification-TO.

This will prevent external recipients from receiving the dreaded pop-up (shown here again for effect) which will generate a incoming read receipt:

A second option is to deploy the Office ADM template in a GPO to remove the ability of users to send out read receipt requests. (You will still need the hub transport rule to block incoming Read Receipt requests).

Now we can move on to Exchange 2010 (can I hear a double yippee?).

With Exchange 2010 we have many new additions to transport rules which would make the subject of a great blog post on its own. The one new addition we are concerned with here is the ability to act on messages based on class. Specifically here we are concerned with the read receipt class. With Exchange 2010 we can craft a transport rule to drop messages based on the read receipt class as shown below:

Now the above Exchange 2010 rule should solve our issue! This is great and wonderful! Finally no read receipt requests leaving OR entering my org!

Well... not so fast.

You see, what the above rule does is block the actual read receipt (the multipart/report; report-type=disposition-notification content type. Check the beginning of this blog post if you forgot. Its ok I'll wait).

This rule will not block the original read receipt request (shown here again because I believe in learning through repetition):

So we are back to either:

  1. Create an incoming rule on your hub and an outgoing rule on your Edge to remove the header.
  2. Set an incoming rule on your hub and use the Outlook ADM file to create a GPO to remove the option to request Read Receipts

So at the end of all this we've learned that while finally in Exchange 2010 we can block actual read receipts with ease, it still takes a bit of doing to block the read receipt request and be rid of all types of RRs entirely. But it is possible.

Tom Kern

Potential for database corruption as a result of installing Exchange 2007 SP3 RU3

$
0
0

Update 3/31/2011: The updated Exchange 2007 SP3 RU3 has been released. See Announcing the Re-release of Exchange 2007 Service Pack 3 Update Rollup 3 (V2).
3/30/2011: We posted a status update for this issue. See Exchange 2007/2010 Rollup 3 Status Update.

Over the weekend, the Exchange Product Group was made aware of an issue which may lead to database corruption if you are running Exchange 2007 Service Pack 3 with Update Rollup 3 (Exchange 2007 SP3 RU3). Specifically, the issue was introduced in Exchange 2007 SP3 RU3 by a change in how the database is grown during transaction log replay when new data is written to the database file and there are no available free pages to be consumed.

This issue is of specific concern in two scenarios: 1) when transaction log replay is performed by the Replication Service as part of ensuring the passive database copy is up-to-date and/or 2) when a database is not cleanly shut down and recovery occurs.

While only a small number of customers have been affected to date, we believe the risk is significant enough that we are recommending all customers to uninstall Exchange 2007 SP3 RU3 on all Mailbox Servers and Transport servers. Uninstalling the rollup will revert the system back to the previously installed version. We have also removed the Exchange 2007 SP3 RU3 download from the Microsoft Download Center and from Microsoft Update until we are able to produce a new version of the rollup.

We are actively working this issue and based on test results plan to release an updated version of Exchange 2007 SP3 RU3 to the Download Center later this week. In addition, we are conducting an internal review of our processes to determine how to prevent issues such as this in the future.

When this issue occurs, the following similar events are logged in the Application Event log of the Mailbox server. Regardless of whether you see these types of events, you should review the recovery instructions and begin that process. If you are uncomfortable performing any of these steps please contact Microsoft Support for assistance.

  • Event ID: 454
    Event Type: Error
    Event Source: ESE
    Event Category: Logging/Recovery
    Description: Microsoft.Exchange.Cluster.ReplayService (12716) Recovery E20 SG1\DB1: Database recovery/restore failed with unexpected error -4001.
  • Event ID: 2095
    Event Type: Error
    Event Source: MSExchangeRepl
    Event Category: Service
    Description: Log file D:\logs\SG1\E200006AFAE.log in SG1\DB1 could not be replayed. Re-seeding the passive node is now required. Use the Update-StorageGroupCopy cmdlet in the Exchange Management Shell to perform a re-seed operation
  • Event ID: 2097
    Event Type: Error
    Event Source: MSExchangeRepl
    Event Category: Service
    Description: The Microsoft Exchange Replication Service encountered an unexpected Extensible Storage Engine (ESE) exception in storage group 'SG1\DB1'. The ESE exception is a read was issued to a location beyond EOF (writes will expand the file) (-4001) ().

In addition, in environments utilizing Continuous Replication, comparison of the database file between the active and passive nodes will indicate that the database file has decreased in size.

Regardless of whether you are experiencing this issue, we strongly recommend taking the below actions to ensure that you do not experience any data loss or outage event associated with this issue.

For example:

  • If you have deployed your Mailbox servers utilizing Cluster Continuous Replication (CCR), failure of the active copies may affect your service SLA as you may have no viable passive copies to activate. Hardware failures may result in you not having a means to recover up to the point of failure and thus may experience data loss.
  • If you have deployed your Mailbox servers utilizing Single Copy Clusters (SCC), switchovers or failovers may result in this issue as there is only one copy of the database and recovery is performed during switchovers and failovers.

For environments leveraging CCR and/or Standby Continuous Replication (SCR)

If you note the listed events in your environment the following steps must be taken in order to restore your high-availability configuration:

  1. Rollback the CCR Mailbox server hosting the passive database copies and any SCR target Mailbox servers to the previously installed version (e.g., Exchange 2007 SP3 RU2) by uninstalling RU3.
  2. Re-seed all affected database copies on the CCR Mailbox server and any SCR target Mailbox servers hosting the passive database copies.
  3. Verify the database copy status is healthy for all passive copies.
  4. Perform a switchover and rollback the remaining CCR Mailbox server to the previously installed version (e.g., Exchange 2007 SP3 RU2).

If you are not seeing these events in your continuous replication enabled environment, we recommend the following steps:

  1. Rollback the CCR Mailbox server hosting the passive database copies and any SCR target Mailbox servers to the previously installed version (e.g., Exchange 2007 SP3 RU2) by uninstalling RU3.
  2. Perform a switchover and rollback the remaining CCR Mailbox server to the previously installed version (e.g., Exchange 2007 SP3 RU2).

For environments leveraging Single Copy Clusters (SCC)

  1. Rollback passive nodes within the SCC environment to the previously installed version (e.g., Exchange 2007 SP3 RU2) by uninstalling RU3.
  2. Perform a switchover and rollback the remaining SCC Mailbox server nodes to the previously installed version (e.g., Exchange 2007 SP3 RU2).
  3. If you have any databases that will not mount as a result of the above issue, you can restore the damaged databases leveraging a last known good backup.

For environments leveraging standalone Mailbox (or Public Folder) servers

  1. Rollback the standalone Mailbox servers to the previously installed version (e.g., Exchange 2007 SP3 RU2) by uninstalling RU3.
  2. If you have any databases that will not mount as a result of the above issue, you can restore the damaged databases leveraging a last known good backup.

For Hub Transport and Edge Transport servers

  1. Rollback the standalone transport servers to the previously installed version (e.g., Exchange 2007 SP3 RU2) by uninstalling RU3.
  2. If any transport servers have mail.que databases which currently do not mount as a result of the above issue, you can recover them by following the steps in Working with the Queue Database on Transport Servers.

Kevin Allison
GM Exchange Customer Experience

Store Driver Fault Isolation Improvements in Exchange 2010 SP1

$
0
0

Background

The Exchange Store Driver is a core transport component which lives both on the Mailbox server role (as the mail submission service) and the Hub server role. It is responsible for:

  • Retrieving messages from the mailbox server that have been submitted by end-users and submitting those to the Hub transport role for categorization and routing.
  • Delivering messages to the appropriate mailbox server based on the location of the recipients mailbox.
  • Extensibility platform for both mail submission & delivery. Store Driver currently hosts a number of agents that extend the functionality of Exchange. Examples include such agents as Inbox Rules, Conversations, meeting forward notifications, etc.

Exchange 2010 is currently being utilized in Live@EDU, as well as the upcoming Office 365. As you can probably imagine, the Exchange servers that run in those datacenters are loaded and pushed harder than almost any other Exchange server imaginable. Prior to SP1, there were several problems that were encountered with mail delivery to the Exchange mailbox store. In particular, there was a need to make sure that a handful of recipients did not starve the rest of the mail delivery system.

While many of you may not have noticed this problem, Microsoft has seen many of these types of cases over the years; often isolated to a single event like an inadvertent public folder replication storm.

This was despite the message throttling that was already available. Transport roles have also had functionality to avoid resource starvation known as Back Pressure, but this was not designed to protect the system from messages that were already in the Local Delivery queue.

Changes in SP1

In order to further protect both the Mailbox servers and Hub servers from resource starvation, new thread limits were introduced in SP1:

KeyDescriptionScenarioError in Connectivity Log:
<add key=”RecipientThreadLimit” value=”1”/>Limit beyond which no more threads can be allocated to the recipient for delivery.

Note: If this is increased, you should increase MaxMailboxDeliveryPerMdbConnections as well, so that slow or hung deliveries to a single recipient will not block delivery for the entire MDB.

Flood of messages to a single Mailbox or a performance problem associated with a single mailbox, has minimal impact on delivery to the rest of the Mailboxes in the database.Throttled delivery for recipient <recipient> due to concurrency limit <limit>
<add key=”MaxMailboxDeliveryPerMdbConnections” value=”2”/>The maximum number of concurrent connections to a single “healthy” Mailbox Database.

Database health is determined by the Health Monitor API and recorded in the connectivity logs as a value between -1, 0-100. 100 being healthy.

Connections hang to a single problematic database have minimal impact on delivery of other queued messagesThrottled Delivery due to server limit for <server FQDN> with threshold

Note: These keys are not present in the EdgeTransport.exe.config file by default.

Is it possible to have too much protection?

Unfortunately, there are two scenarios after applying SP1 where we are seeing customers with messages backing up in the queue. The temporary error message is:

432 4.3.2 STOREDRV.Deliver; recipient thread limit exceeded

As you can probably guess, the two scenarios are:

  • Journaling
  • Public Folders

In both cases, the deliveries are occurring to a single recipient (or very small number of recipients). This is likely to occur during heavy mail flow. The screen shot below was taken from a lab server while reproducing the issue:

Screenshot: Messages backed up in mailbox delivery queue due to recipient thread limits
Figure 1: Messages backed up in mailbox delivery queue due to recipient thread limits being exceeded (click here for larger screenshot)

You can see a historical history of 4.3.2 events in connectivity logs on your Hub Transport servers (in the \Program Files\Microsoft\Exchange Server\V14\TransportRoles\Logs\Connectivity\CONNECTLOGxxxxxxxx-x.LOG), like:

#Software: Microsoft Exchange Server
#Version: 14.0.0.0
#Log-type: Transport Connectivity Log
#Date: 2011-01-12T00:00:00.775Z
#Fields: date-time,session,source,Destination,direction,description
 
2011-01-12T00:00:00.775Z,08CD7F1200CBDBD0,MapiSubmission,5f24e416-c380-41b5-bfe0-37b6f1091f49,>,"Failed; HResult: 1140850693; DiagnosticInfo: Stage:LoadItem, SmtpResponse:432-4.3.2 STOREDRV; mailbox server is too busy"
 
2011-01-12T00:00:00.775Z,08CD7F1200CBDBD0,MapiSubmission,5f24e416-c380-41b5-bfe0-37b6f1091f49,-,RegularSubmissions: 0 ShadowSubmissions: 0 Bytes: 0 Recipients: 0 Failures: 1 ReachedLimit: False Idle: False
 
2011-01-12T00:00:05.792Z,08CD7F1200CBDBD1,MapiSubmission,5f24e416-c380-41b5-bfe0-37b6f1091f49,+,Win2k8R2Ex14.dom2k8r2ex14.lab

In some cases, simply leaving the servers alone should cause the queues to slowly drain. In other cases, it may be necessary to take further action because the problem has persisted for a while or because it isn’t part of a one-time event like a Public Folder replication storm.

Alright, I understand. Now how do I fix my situation?

Like every other throttling & performance related feature that has ever been in Exchange, the solution isn’t exactly straight forward. For starters, we’ve seen some level of success simply incrementing both values up one, as follows:

<add key="RecipientThreadLimit" value="2" />
<add key="MaxMailboxDeliveryPerMdbConnections" value="3" />

In fact, there has been enough success with this that we’re considering changing the defaults in a future rollup or service pack. Of course, when we do, the new defaults will only apply to those who haven’t already modified the values. Although it has not yet been released, KB 2491972 will discuss the change when the time comes.

So if +1 is better, then why not +2 or more?

Well, the problem is that all Exchange servers will ultimately be bound by some hardware resource. You don’t want to introduce thrashing or resource starvation due to a public folder or journaling server event that now impacts all users as well. In addition, there are other limits that control the maximum number of threads that can service these types of deliveries. In short, we are not recommending going above 4 for MaxMailboxDeliveryPerMdbConnections, and RecipientThreadLimit should always be at least one fewer.

In an extreme case, if you are in a very busy environment with dedicated journaling mailbox servers, it may be worth considering having dedicated hub transport servers to go along with that. Of course, they can be virtualized or multi-role boxes, but in order to be isolated, the whole bunch will need to be in a dedicated site. Then, you would be able to increase these limits without risking delivery to other mailboxes.

Of course, this is an extreme example. For the rest of us, it may be as simple as trying the +1 approach while carefully monitoring the hub & mailbox servers.

Scott Landry, Steve Schiemann, Frank Brown and Jason Nelson

Accepted Domains, Safe Senders List and You

$
0
0

You may have noticed a change in the behavior of the Safe Senders list within Outlook starting in Exchange 2010. Users can no longer add accepted domains to Outlook’s Safe Senders list.

Screenshot: Adding an accepted domain to Outlook's Safe Senders list
Figure 1: Adding an accepted domain to Outlook's Safe Senders list

This was done as an anti-spam deterrent as we have all seen cases where Joe The Spammer spoofs the mail from your own domain. Adding your own domain to the Safe Senders list would bypass all Outlook client-side anti-spam checks, dumping that message from the Nigerian prince (spoofed using your own domain) into your users’ Inboxes. Not so good unless you were really waiting for that business opportunity.

A valid SPF record and our anti-spam agents (specifically the SenderID agent) would go a long way to block these types of spam. However, many customers out there have not exactly jumped on the SPF bandwagon.

You can learn more about SenderID filtering in Sender ID and Understanding Sender ID. Use the Sender ID Framework SPF Record Wizard to create an SPF record for your domain.

With Exchange 2010, you CAN still add individual email addresses from your own accepted domains to the Safe Senders list - you just can’t add the entire domain, as shown in the screenshot above.

What happens if you DO decide to add the whole domain?

If you try to do this for a user via the Shell, you will get the very helpful error below:

“<@yourdomain.com>” is your e-mail address or domain and can’t be added to your Safe Senders and Recipients list.
Figure 2: If you try to add an accepted domain to user’s Safe Senders list using the Shell, you get an error indicating its your domain or e-mail address

We tell you exactly why we are throwing an error.

How about when a user does this via Outlook? First, Outlook lets the user add a domain.


Figure 3: Although users can add an accepted domain to their Safe Senders list in Outlook, it is automatically removed in a few minutes

However after a few minutes the entry will magically disappear.

The Disappearing Safe Senders List

In Exchange 2010 SP1, a bug was introduced where if the user added the accepted domain to his/her Safe Senders list via Outlook - not only would the accepted domain entry disappear but it would take the user’s entire safe senders list with it. This was fixed in E2010 SP1 RU3v3 where we are back to the expected behavior.

Allowing app servers to send as your own domain

Many customers have various applications that submit mail anonymously to Exchange where the messages come from email addresses from your accepted domains.

Some of you have apps submitting from so many accepted domain addresses that it wouldn’t be feasible (let alone fun) attempting to add all of these addresses individually to the safe senders list in Outlook to ensure these messages do not end up in junk mail.

Now that we can’t add the whole domain, what are our options?

  • We know that adding all the addresses manually is an available albeit painful option
  • A second option is to disable Outlook’s client side filtering (yeah... not a good idea, so do not seriously consider it. Spam checks out the window!)
  • A third and best option is to install the anti-spam agents on your relay hub(s) and add the IPs of your app servers to the IP Allow list of the connection filtering agent as documented here.

When the sending SMTP host’s IP address is on the IP Allow List in Exchange, it bypasses all anti-spam checks (except sender/recipient filtering) and the Content Filter agent stamps an SCL of -1 on the message which Outlook will honor.

Here's what the message header will look like:

X-MS-Exchange-Organization-AuthAs: Anonymous
X-MS-Exchange-Organization-Antispam-Report: IPOnAllowList
X-MS-Exchange-Organization-SCL: -1

So, go ahead and run the Install-AntispamAgents.ps1 from the Scripts folder on your Hub Transport server, and then add IP addresses or subnets of our application servers to the IP Allow List.


Figure 4: Adding IP address or address range of internal app servers to the IP Allow List using the EMC

If using the Shell, use this command to add an IP address to the IP Allow List:

Add-IPAllowListEntry –IPAddress 192.168.10.120

What Not To Do: Using Externally Secured Authentication

Now I know what you’re thinking: Why don’t we just add Externally Secured Authentication as an authentication type on a Receive Connector, scope the connector’s remote IP range to the sending application servers and call it a day?

Well, not so fast... you see, while Externally Secured gives the sending IP the ms-Exch-Bypass-Anti-Spam extended right, this only circumvents the Exchange Anti-Spam checks, not Outlook’s. And it is Outlook that’s moving the message into junk mail in this case.

Also note that Externally Secured does not stamp any SCL X-headers on the message as an SCL of -1 would’ve bypassed Outlook’s checks. The only header this authentication type creates is the one below:

X-MS-Exchange-Organization-AuthAs: Internal

If you're still confused about Exchange and Outlook anti-spam checks, take a look at Exchange anti-spam myths revealed.

Big thanks to Tak Chow for tech reviewing this post.

Tom Kern

Exchange Server and SP1 for Microsoft Office Filter Pack 2010

$
0
0

Starting with Exchange 2007, installation of the current version of Office Filter Packs is a prerequisite. For Exchange 2007 and Exchange 2010 RTM, the pre-req was 2007 Office System Converter: Microsoft Filter Pack. In Exchange 2010 SP1, this was updated to Office 2010 Filter Packs. The filters are used by Exchange Search to index email attachments on Mailbox servers and by the transport rules agent to scan attachments on transport servers. The filters are also important for discovery searches in Exchange 2010 – Multi-Mailbox Search uses content indexes generated by Exchange Search.

In Exchange 2010 RTM and Exchange 2007, you need to register the IFilters with Exchange Search (for Exchange 2007, see 'KB 944516 How to register Filter Pack IFilters with Exchange Server 2007'). In Exchange 2010 SP1, IFilters included in the Office 2010 Filter Pack are automatically registered by Exchange Setup. You must register any third-party filters you install.

An updated filter pack, Service Pack 1 for Microsoft Office Filter Pack 2010 (KB2460041) 64-bit Edition is now available on Download Center. The Filter Pack has been tested with Exchange 2010 and Exchange 2007. The updated filter pack doesn’t have any fixes or updates that impact Exchange scenarios or functionality. If you have the RTM version of Office 2010 filter packs installed, you can update it but it’s not required. For new installs, we recommend going with the current versions.

Note: The SP1 package updates the RTM version of Office 2010 Filter Packs.

Bharat Suneja

Viewing all 197 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>