Scripting. Powershell, VMware, Windows, Active Directory & Exchange. All that kind of stuff…..
RSS icon Email icon Home icon
  • Windows Server 8 – Now with PowerShell Cmdlets for DHCP

    Posted on September 15th, 2011 Jonathan Medd 7 comments

    *****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
    
    

    103!

    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 192.168.100.50 -EndRange 192.168.100.100 -SubnetMask 255.255.255.0
    
    

    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 :-)

    Update:

    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:

     

    4 responses to “Windows Server 8 – Now with PowerShell Cmdlets for DHCP” RSS icon

    • Great, this is really enhancing completely integrated management of all MS technologies with PowerShell. Me thinks you will be busy with all the new features!

      Now, I hope they actually delivery DHCP Server load balancing and failover.

    • Yep, it’s looking good :-)

      Updated the post with a sneak peek at Set-DhcpServerv4Failover. No description, but hopefully that will be along the lines of what you are looking for…….

    • At last! Can it really be true? Something I’ve been asking for since Windows 2000. Excellent news indeed! Trying to manage any but the smallest installation using the gui is painful, even using crude scripts based upon manipulating NETSH. Looking forward to getting my life back.

    • That is awesome news indeed, but for those of us unable to roll our production environments over to Windows Server 08, check out the code gallery.

      http://gallery.technet.microsoft.com/05b1d766-25a6-45cd-a0f1-8741ff6c04ec

      A really awesome addition to DHCP management for us to use right now on production 08 and 03 boxes.


    3 Trackbacks / Pingbacks

    Leave a reply