Microsoft DHCP Documentation Script Update Version 1.40

April 5, 2018

DHCP, PowerShell

In more ways than a simple bump from 1.35 to 1.40, this update feels like a new version. In doing Active Directory Health Checks for my employer, Choice Solutions, I “eat my own dog food” and use a lot of my scripts to gather data needed. I have wanted, for a long time, to add the ability to process all DHCP servers found in AD but it took a request from Rob Ingenthron to get me to do it.

Rob has several more DHCP script enhancement requests that I will implement as V1.4x. Adding the ability to process all DHCP servers is the simplest request he has. The others will take some time to code.

In order to make this change, I had to take this script I created in 2012 and bring it up to the coding style used in all the other documentation scripts. First, I had to take the massive blob of “COBOL” style code and break it into Functions. Second, was to group all the Functions into Regions. Next, was to install Visual Studio Code and go through a massive code cleanup process. Then the fun started for my most thorough tester, David McSpadden. He ran the script through about every possible combination of parameters and sent me the error logs from every run. This helped me track down all the variable scoping and other issues in the code. David is a very patient tester and he ran hundreds of tests for me in the process of getting 1.40 ready for you.

Thank you, David, for your patience and persistence. Thank you, Rob, for all the enhancement requests you sent me for this script. I have a lot of work ahead of me.

#Version 1.40 5-Apr-2018

  • Added -AllDHCPServers (ALL) parameter to process all Authorized DHCP servers that are online
    • Added text file (BadDHCPServers_yyyy-MM-dd_HHmm.txt) of the authorized DHCP servers that
    • are either offline or no longer have DHCP installed
  • Added -Hardware parameter
    • Added functions to output hardware information
  • Code clean-up for most recommendations made by Visual Studio Code
  • Fixed several minor issues found during testing from the code cleanup
  • Grouped code into functions and functions into regions
  • In the Scope Options, if all Scope Options inherit from Server Options and the only
    • scope option is the implied Option ID 51; then blank lines were inserted. This is now
    • fixed so “None” is reported, just like all the other items. For some reason, Option ID
    • 51 is implied and even though it does not show in the console, the PowerShell cmdlet
    • exposes it. If I try and retrieve the properties of that option, it can crash the computer
    • running the script. Not a good thing if you are running the script on a DHCP server. I now
    • check for this specific condition, and it is now handled properly for all output types.
    • Many thanks to my exhaustive tester, David McSpadden, for helping find and fix this logic flaw.
  • Updated help text

You can always find the most current script by going to http://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

Thanks

Webster

About Carl Webster

Webster is a Sr. Solutions Architect for Choice Solutions, LLC and specializes in Citrix, Active Directory and Technical Documentation. Webster has been working with Citrix products for many years starting with Multi-User OS/2 in 1990.

View all posts by Carl Webster

No comments yet.

Leave a Reply