November 2009 Blog Posts

One of the new features in Power Pack 3 is a dashboard-style plug-in for Windows Media Center that gives you a snapshot of the Home Server’s status on your TV. Now, I don’t use Media Center (long live Popcorn Hour), but I do think that a dashboard status view is pretty cool.

The question becomes, then, how do we co-opt the Media Center plug-in for our own nefarious uses?

Data Acquisition

The Media Center plug-in reads from an XML file published through the Windows Home Server “system” web site (the one that runs on port 55000, that you can grab the Connector installer from). Take a look at http://yourserver:55000/health/health.xml (the actual file lives in C:\Inetpub\Intranet\health\health.xml).

You’ll see something like this:


There is some tasty information in there, including the IP address of each client machine currently connected to the server, all sorts of storage counters, and even your system’s uptime.

Schema Generation

We need to read this file, of course, and the easiest way to do that is to deserialize the XML into a usable .NET class. Bring on xsd.exe.

  1. Download health.xml and save it somewhere
  2. Start up your Visual Studio command prompt
  3. Run xsd health.xml to generate a health.xsd file
  4. Run xsd health.xsd /classes to generate a health.cs file (you can specify /language:vb if you’re a Visual Basic person)
  5. Import health.cs into your Visual Studio project

Helpfully, xsd has sort of mangled our new class a bit. Open health.cs and you’ll see a bunch of private fields.

public partial class HomeServerHealth {
    private HomeServerHealthStorageStorageInfo[][] storageField;
    private HomeServerHealthSharesShareInfo[][] sharesField;
    private HomeServerHealthBackupComputerInfo[][] backupField;

We need to fix those arrays so the XML deserializer won’t throw its toys out of the cot. Do a find and replace across the whole file, replacing “[][]” with “[]”, so we get this:

public partial class HomeServerHealth {
    private HomeServerHealthStorageStorageInfo[] storageField;
    private HomeServerHealthSharesShareInfo[] sharesField;
    private HomeServerHealthBackupComputerInfo[] backupField;

Much better.


I’ve covered XML serialization before. This is just more of the same, except we’re downloading a file from the server rather than opening one from disk.

I created a new WinForms project, and dropped a Button and DataGridView control onto the Form. This gives me a quick and dirty way to preview the data. The Button’s Click event looks like this:

private void button1_Click(object sender, EventArgs e)
    WebClient downloader = new WebClient();

    using (Stream xmlStream = downloader.OpenRead(@"http://yourserver:55000/health/health.xml"))
        XmlSerializer serializer = new XmlSerializer(typeof(HomeServerHealth));
        HomeServerHealth health = (HomeServerHealth)serializer.Deserialize(xmlStream);

        dataGridView1.DataSource = health.Disks;

You can see I’m binding the Disks array to the DataGridView. Running the project and clicking the button downloads the current health.xml and displays the contents of the Disks array.


Binding to Shares instead of Disks shows this:



The health.xml file gets updated quite often (once per minute, from what I can tell), so you can get up-to-date status just by polling the URL. The LastUpdated property also contains the exact time the file was updated by Windows Home Server.

There are a bunch of arrays you can loop through to gather interesting statistics:

  • Backup (client computer information, including number of days since last backup and IP address)
  • Disks
  • Hardware (manufacturer of the server, WHS version and uptime)
  • MediaCounts (the number of media files in each media Shared Folder, and how many more you can fit)
  • Notifications (the current Notification queue, including Notifications normally hidden from the WHS Console)
  • Shares (including duplication status)
  • Storage (aggregate storage usage for some high-level categories, the same as the WHS Console pie chart)

I’m very interested to see who runs with this new functionality. Given that the web site isn’t published (port 55000 is only accessible inside the network by default), you’d need to build another ASP.NET app to make this data externally accessible. But then you could make a neat mobile phone version (or whatever) to view the data.

I think this is a great direction for the WHS SDK team to go; this is the first time we have a way for applications to get status information from WHS without having to reference specific Home Server assemblies, making the data a lot more portable.

LifeHacker has a follow-up post on their favourite WHS Add-Ins:


In our overview last week, we briefly touched on the idea of using add-ins to enhance your Windows Home Server experience and get more out of the console. This week we're highlighting five add-ins and providing a little more detail on their functionality and how they make your Windows Home Server experience even better.

WHS Disk Management is the first Add-In listed. I’m going to interpret that favourably!


Site Sections

Recent Posts


Post Categories

WHS Add-In Tutorial

WHS Blogs

WHS Development