Extending the free Session Broker that's built-in to Windows Server 2008 - Brian Madden - BrianMadden.com
Brian Madden Logo
Your independent source for desktop virtualization, consumerization, and enterprise mobility management.
Brian Madden's Blog

Past Articles

Extending the free Session Broker that's built-in to Windows Server 2008

Written on Sep 26 2008
Filed under:
7,326 views, 7 comments

by Brian Madden

Can you believe that Windows Server 2008 has been on the market for over six months now? Last May I wrote about the new Terminal Server features of Windows 2008, including what Microsoft calls the TS Session Broker. (And in fact, Michel Roth wrote a very in-depth overview of this feature last summer.) The TS Session Broker is used to route incoming RDP connection requests to an appropriate terminal server, be it a user with an existing disconnected session somewhere in the farm that should be routed back to that server, or a new user that should be sent to the least-loaded server in the farm. The biggest complaint that people have about the TS Session Broker is that it's a bit hard to configure. (Well, maybe not "hard" per se, but it's definitely complex.) The good news about that being the only complaint is that once the Session Broker is up and running, it works well--the pain is only one-time.

Like many features of Windows Server, the TS Session Broker is a "platform" feature that provides basic functionality, but Microsoft wrote it in such a way that it's highly extensible. To that end, the Microsoft Terminal Server team has started blogging about the various ways that the Session Broker can be extended. For example, Christa Anderson (she's at Microsoft now) wrote about how you can use the Session Broker's APIs to remove the built-in load balancing mechansim (that only allows connections to Terminal Servers) and replace it with your own code that does whatever you want, including brokering connections to desktops for VDI scenarios.

Following up on Christa's post, Roman Porter just posted the first entry in a series that will walk you through creating your own load-balancing logic to override the basic stuff from Microsoft. (The other biggest complaint of the TS Session Broker is that its load-balancing logic is too simplistic.) I'm not a programmer, so I don't know how hard this would be to do, but how cool would it be to make a free plug-in / extenstion to the built-in load-balancer that would extend it so it could use any perfmon counter you wanted? I would imagine you could even build a little list of counters, specify your maximum and minimums, and off you go!

If this were the case, I'd personally make some load-balancing rules that primarily looked at the total users on a server, but I'd also want to take into consideration things like processor queue lenght, memory pages input per second, disk queue length, and network queue length. (Unfortunately, none of these counters are exposed in XenApp.) This would also be cool because if you were using something like RTO PinPoint which creates its own "logon speed" perfmon counters, you could factor that into your load-balancing decision as well.


Our Books


Rene Vester wrote API's are great ...
on Fri, Sep 26 2008 10:24 AM Link To This Comment

I think API's are great, and seeing as we now have the options to extend a product like terminal servers and ourselves be able to fill the holes that exist in any product in this business is a great development :-)

I think a lot of consulting companies will have to rethink their hiring strategy as hiring only infrastructure people to do infrastructure, like it has been historically, is going to be obsolete. I think actually the new team of infrastructure consultants will team up with developers to be able to deliver ofcourse standard products directly from the vendor, but also custom "pimped" plugins.

 Why hack some incredible complex script to solve an issue with an infrastructure mind, when you can use the vendors API and a developer mind to create something elegant?

But that said, it is going to require a change of mind-set i think.. But it would be great for companies all over, getting even more elegant solutions to the pains of their businesses.

/Rene Vester

Rene Vester wrote Re: API's are great ...
on Fri, Sep 26 2008 10:26 AM Link To This Comment

Maybe Infrastructure development will actually get a budget, so we people dont have to live with a standard vendor solution :-)

Benny Tritsch wrote Re: API's are great ...
on Fri, Sep 26 2008 1:15 PM Link To This Comment

Rene, I completely agree. But from my own experience I can tell you that it's very hard to find those "infrastructure developers" out there. Just ask in the dev community if there is someone who is able to develop command-line tools, system-level GUI tools, services and filter drivers in C or C++. You will hardly find any, or if you find them they have good jobs at product companies and don't want to join an IT Pro shop. System development is an art that is not taught at many of today's Universities anymore.

So, where are the good system developers who want to work for a consulting company specialized in IT infrastructure?


Guest wrote Session Broker load-balancing is also FIXED
on Thu, Oct 2 2008 5:06 PM Link To This Comment

Apparently load-balancing had a bug which lead to sub-optimal load-balancing with default LB algorithm as well as "max number of sessions" feature problems.

Fixed by this hotfix - strongly recommend for any Session Broker load-balancing deployments:



Patrick Rouse wrote Session Broker Licensing
on Thu, Oct 2 2008 6:08 PM Link To This Comment
One thing to keep in mind when using Microsoft's Session Broker, or any other 2008 TS Infrastructure component is that a 2008 TSCAL is required, even if the client is connecting to a Virtual or Physical Desktop (at least this is what we were told in the spring).  I suppose you could think of this as Microsoft's Connection Broker licensing cost, which they currently get when connecting to Terminal Servers.  We'll have to see what mechanisms they put in to track this usage.
Rene Vester wrote Re: Session Broker Licensing
on Mon, Oct 6 2008 7:55 AM Link To This Comment

I guess they had to think of something to get paid for anything that crosses their path ;) it was easy with things based on Terminal Services, guess they had to do something for the case of VDI :)


Jonathan Braunhut wrote Cool free plug-in for PerfMon integration
on Mon, Oct 6 2008 8:52 AM Link To This Comment

<Shameless Commercial Plug>

Every LoadMaster load balancer from KEMP Technologies comes bundled with a Windows binary (LoadMaster Adaptive Agent for Windows) that can incorporate any or all PerfMon metrics to make load balancing decisions.  It's nothing new, either....KEMP has been shipping this Agent for over two years!  (It's a 32-bit binary that'll run fine on all 32- or 64-bit Windows.)  What is new (relatively) is the LoadMaster's  L7 TS load balancing functionality -- fast, persistent TS load balancing with session reconnection WITH OR WITHOUT without Session Broker.


Christa Anderson's blog about VDI brokering is neat new stuff to us. Our prople are looking at this to see if there are opportunities to add value in this space from the hardware side of things.




Jon Braunhut


KEMP Technologies

(Note: You must be logged in to post a comment.)

If you log in and nothing happens, delete your cookies from BrianMadden.com and try again. Sorry about that, but we had to make a one-time change to the cookie path when we migrated web servers.