A Quick Guide to Server Draining in Lync Server 2010

Server draining was a new feature introduced in Lync Server 2010 that allows administrators to gracefully take a server offline for maintenance. What this means is that it ensures that existing client connections to/through the server are allowed to continue, but all new connections are refused. Once the server is completely “drained” of connections, the services are stopped and the administrator can then patch, restart or reconfigure the server without impacting users.

In this example, I’m draining connections on a Lync Server 2010 Mediation Server in preparation for maintenance.

The first cmdlet I run in Lync Server Management Shell on the server I want to drain is Get-CsWindowsService. This returns a list of all the Lync services running on the server:

To drain this Mediation Server, I want to stop the RTCMEDSRV service only (side note: for a Front End server the main service I’d be looking to stop to ensure no more clients logged on would be RTCSRV). I can leave the REPLICA service running as this doesn’t affect client connections and ensures CMS changes are still replicated to this server.

Next I run the cmdlet Stop-CsWindowsService –Name RTCMEDSRV -Graceful. Specifying the -Graceful switch ensures the service is drained and existing client connections are allowed to continue like I mentioned above.

Once I’ve run the above cmdlet, in the Services MMC snap-in I see that the Lync Server Mediation service status is listed as Paused. In the Lync Server event log, I also see event ID 25049 informing me that the service has started to drain:

The service may stay in a Paused status for a while, depending on how long users stay on the phone for. 🙂

Once all connections have completed and disconnected, I see Event ID 25050 informing me that the service has completed draining:

Finally, Event ID 25003 is logged informing me that the service has now stopped:


This feature is really useful in resilient environments for diagnosing problems, taking servers offline for cumulative update patching, reconfiguring certificates or restarting the server completely. It can be used for any Lync Server role and gives you the flexibility to keep the lights on for users and not interrupt service but still perform maintenance during business hours.

If you’ve any questions about how this works or you’d like more information, drop me a line in the comments below.

2 thoughts on “A Quick Guide to Server Draining in Lync Server 2010

  1. Pingback: A Quick Guide to Server Draining in Lync Server 2010 | Justin Morris on UC « JC’s Blog-O-Gibberish

  2. John

    Draining would be better if there was an easier way to investigate connections that persist. Some take way too long to end on their own. This would be a good use of an admin utility.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.