Windows Server 8 - Now with PowerShell Cmdlets for DHCP

*****Warning. This is from a preview release******

In Windows Server 2008 R2 there were a number of modules included for managing typical server roles such as Active Directory, Failover Clustering etc. However, there were some noteable absentees, such as DHCP server.

You may ask why am I highlighting PowerShell cmdlets for DHCP, well:

  1. Fellow London VMUG regular Julian Wood commented on my PowerShell v3 First Look Post asking if there were DHCP cmdlets this time.
  2. Whether there are or not this time would indicate how cmdlet coverage is progressing.

So after firing up Windows Server Developer Preview it was good to see that there are now cmdlets for DHCP Server.

Firstly, add the DHCP Server Role:

Add-WindowsFeature DHCP

…and take a look at the DHCP server module.

Get-Module \*DHCP\* -ListAvailable

Now, let’s see how many cmdlets we have in that module:

(Get-Command -Module DHCPServer).count


So, let’s have a look at what kind of things we can do.

Get-Command -Module DHCPServer

Let’s try adding a new scope:

Add-DHCPServerv4Scope -Name "Test Scope" -StartRange -EndRange -SubnetMask

Now it’s also easy to report on that scope:

Get-DhcpServerv4Scope | Format-List \*

The presence of the DHCP Server module is a good indicator that it is now pretty hard to ship a component of Windows Server without adding PowerShell support.

Hopefully 103 DHCP Server cmdlets is enough to make Julian happy :-)


Julian mentions in the comments about DHCP failover and loadbalancing. Haven’t had time to play with the technologies yet, but this might be a good indicator: