WhatTookSoLongIt appears the Networking team is looking for feedback on how to improve future releases of the Microsoft DHCP server role in Windows Server.  For me, the first thing that comes to mind is:

Add WMI support

This has always been one of the "Duh" points in the whole management of network services for me.  You really can’t get access to DHCP server information such as scope definitions, or lease information programmatically.

Sure, netsh is a great tool for doing some management tasks, or dumping configuration data to text files, but that requires parsing out of data, in an attempt to make it useful.

I would like to see WMI infrastructure established to access DHCP server information, so that I can write a tool in .NET or using Powershell to do specific administration or reporting tasks.

Some ideas that could be done if DHCP server was exposed via WMI:

  • Report on Scope definitions per server – It would be great to write a program or script to enumerate all your DHCP servers, and collect information around about your environment.  This could be used to compare to subnets defined in Sites and Services within Active Directory, to avoid having gaps in Active Directory Domain Services (ADDS) availability
  • Subnet Provisioning – It would be simple to write an application or Workflow for adding new subnets to DNS and DHCP, so that lease times in DHCP are in alignment with DNS refresh times in high traffic areas.
  • Easier Migrations – Netsh works ok for backing up a DHCP server to be migrated to another server, or when upgrading a server, but allowing WMI could ease this as well

 

So why have we not seen WMI support for DHCP in the past?  Was there a technical reason why it couldn’t be done, or was it just not something people were asking for?

Also maybe a nice .NET framework class around WMI for Network Services management similar to System.DirectoryServices.AccountManagement for managing Active Directory accounts?   System.NetworkServices.DHCP or System.NetworkServices.DNS?

Here is a .NET DNS Client Library for those interested.

There is the COM+ DHCPOBJS.DLL from the Windows 2000 resource kit, which you can use with .NET to manage DHCP, but I think a specific .NET class would be a much better solution.  Here is a link on how to use DHCPOBJS with C# if you want to give it a try.

 

Technorati Tags: ,,
  • I have had my debates with some developers at Microsoft about this. There seems to be no consistancy as to how APIs are developed sometimes its PowerShells, others its WMI others (like Task Scheduler on Vista) there is a COM object that can only run from Vista. Personally my problem with WMI is that it is normally not made available for downlevel Operating Systems so if they integrate it into the next Version of Server OS then it wont help you manage anything older. Personally I like the idea of all Management tasks being made into the .NET classes that you suggest that wrap Win32 APIs and allow you to connect to any version of DHCP (etc) but obviously certain features (such as IPv6) returning null values or exceptions should you run them against a version that doesn't support that function.
    In the mean time you have the limited functionality of dhcpobs.dll which is fine until you need to read lease information or IPv6 (or anything else that was added since Windows 2000)

  • I have had my debates with some developers at Microsoft about this. There seems to be no consistancy as to how APIs are developed sometimes its PowerShells, others its WMI others (like Task Scheduler on Vista) there is a COM object that can only run from Vista. Personally my problem with WMI is that it is normally not made available for downlevel Operating Systems so if they integrate it into the next Version of Server OS then it wont help you manage anything older. Personally I like the idea of all Management tasks being made into the .NET classes that you suggest that wrap Win32 APIs and allow you to connect to any version of DHCP (etc) but obviously certain features (such as IPv6) returning null values or exceptions should you run them against a version that doesn’t support that function.
    In the mean time you have the limited functionality of dhcpobs.dll which is fine until you need to read lease information or IPv6 (or anything else that was added since Windows 2000)