When you work with farms with multiple WFE’s that sits behind a loadbalancer and Virtual IP it can sometimes be difficult troubleshooting since you don’t know what server your client is connected to.

I sometimes use Fiddler (which is a great tool by the way) when inspect the HTTP traffic, but without a custom HTTP Header it makes the hole process much more difficult.

Once again, I’m not much for repetitive tasks and in this case I had a lot of WFE’s and web applications. Therefore I put together a small script that enumerates and adds ServerName: [Servername] as custom HTTP header to all your sites on the server. You find it in my download section under IIS. And please don’t hang me for not making a beautiful script, It was a quick and dirty one and if you want to shape it up please feel free to do so.



  1. Terry on Thursday 27, 2009

    Mattias,

    Thanks for the sample code. I had a different need – adding a custom HTTP Header to force IE7 compatibility to about 50 web sites across 30 or so servers – but with your example, it was trivial to do.

    Terry



Subscribe without commenting