Skip to main content

It’s essential to configure the TCP KeepAliveTime in Exchange Server. By default, it’s not set, and you have to do that yourself by creating a DWORD (32-bit) value in the Windows Registry. In this article, you will learn how to set TCP KeepAliveTime in Exchange Server.

TCP KeepAliveTime

Microsoft recommends setting the TCP KeepAliveTime registry entry on the Exchange Server to a decimal value between 900000 and 1800000 (15 to 30 minutes in milliseconds). If there’s no entry in the registry for KeepAliveTime, then the default value is 2 hours.

If not set correctly, this value can affect both connectivity and performance. You must ensure that the load balancer and any other devices in the path from client to Exchange are configured correctly.

The goal is to set Exchange with the lowest value so that client sessions, when ended, are ended by Exchange and not by the device.

Check TCP KeepAliveTime setting

An excellent way to check the TCP KeepAliveTime setting is to create an Exchange Server Health Report with the Exchange Health Checker PowerShell script .

This is what the Exchange Server Health Report looks like in our example.

Set TCP KeepAliveTime in Exchange Server error

Not Set Error: Without this value the KeepAliveTime defaults to two hours, which can cause connectivity and performance issues between network devices such as firewalls and load balancers depending on their configuration. More details:

How to set TCP KeepAliveTime in Exchange Server

Set TCP KeepAliveTime in Exchange Server by following the steps below:

1. Open the Registry Editor on the Exchange Server.

2. Navigate to the following registry key:


3. Right-click the Parameters key, select New, and then select DWORD (32-bit) Value.

Set TCP KeepAliveTime in Exchange Server DWORD Value

4. Type KeepAliveTime as the name for the new value, and then press Enter.

5. Double-click the new KeepAliveTime value, select Decimal as the base, type 1800000 as the value data, and click OK.

Note: The value data 1800000 specifies the time (in milliseconds) that TCP will wait before sending a keepalive packet on an idle connection. In this example, the keepalive packet will be sent every 30 minutes.

Set TCP KeepAliveTime in Exchange Server Value data

6. Close the Registry Editor.

7. Restart the Exchange Server.

Note: Changes to the registry require a restart of the computer to take effect.

Verify TCP KeepAliveTime setting

Run the Exchange Health Checker script  and check the TCP KeepAlive setting in the Exchange Server Health Report.

Set TCP KeepAliveTime in Exchange Server good

Everything looks great!

Leave a Reply