Microsoft DHCP As Built Report is a PowerShell module which works in conjunction with AsBuiltReport.Core.
AsBuiltReport is an open-sourced community project which utilises PowerShell to produce as-built documentation in multiple document formats for multiple vendors and technologies.
Please refer to the AsBuiltReport website for more detailed information about this project.
Sample Microsoft DHCP As Built report HTML file: Sample Microsoft DHCP As-Built Report.html
Sample Microsoft DHCP As Built report PDF file: Sample Microsoft DHCP As Built Report.pdf
Below are the instructions on how to install, configure and generate a Microsoft DHCP As Built report.
The Microsoft DHCP As Built Report supports the following DHCP server versions;
- 2012, 2016, 2019 & 2022
This report document the DHCP server service Forest/Domain wide.
If you need to document an standalone DHCP server a better option is to use the AsBuiltReport.Microsoft.Windows report.
This report is compatible with the following PowerShell versions;
Windows PowerShell 5.1 | PowerShell 7 |
---|---|
β | β |
PowerShell 5.1, and the following PowerShell modules are required for generating a Microsoft DHCP As Built Report.
This report does not support Linux or Mac due to the fact that the ActiveDirectory/GroupPolicy modules are dependent on the .NET Framework. Until Microsoft migrates these modules to native PowerShell Core, only PowerShell >= (5.x, 7) will be supported on Windows.
A Microsoft DHCP As Built Report can be generated with DHCP operator level privileges. Since this report relies extensively on the WinRM component, you should make sure that it is enabled and configured. Reference
Due to a limitation of the WinRM component, a domain-joined machine is needed, also it is required to use the FQDN of the DC instead of its IP address. Reference
Install-Module -Name AsBuiltReport.Microsoft.DHCP
Install-WindowsFeature -Name RSAT-AD-PowerShell
Install-WindowsFeature -Name RSAT-DHCP
If you are unable to use the PowerShell Gallery, you can still install the module manually. Ensure you repeat the following steps for the system requirements also.
- Download the code package / latest release zip from GitHub
- Extract the zip file
- Copy the folder
AsBuiltReport.Microsoft.DHCP
to a path that is set in$env:PSModulePath
. - Open a PowerShell terminal window and unblock the downloaded files with
$path = (Get-Module -Name AsBuiltReport.Microsoft.DHCP -ListAvailable).ModuleBase; Unblock-File -Path $path\*.psd1; Unblock-File -Path $path\Src\Public\*.ps1; Unblock-File -Path $path\Src\Private\*.ps1
- Close and reopen the PowerShell terminal window.
Note: You are not limited to installing the module to those example paths, you can add a new entry to the environment variable PSModulePath if you want to use another path.
The Microsoft DHCP As Built Report utilises a JSON file to allow configuration of report information, options, detail and healthchecks.
A Microsoft DHCP report configuration file can be generated by executing the following command;
New-AsBuiltReportConfig -Report Microsoft.DHCP -FolderPath <User specified folder> -Filename <Optional>
Executing this command will copy the default Microsoft DHCP report JSON configuration to a user specified folder.
All report settings can then be configured via the JSON file.
The following provides information of how to configure each schema within the report's JSON file.
The Report schema provides configuration of the Microsoft DHCP report information.
Sub-Schema | Setting | Default | Description |
---|---|---|---|
Name | User defined | Microsoft DHCP As Built Report | The name of the As Built Report |
Version | User defined | 1.0 | The report version |
Status | User defined | Released | The report release status |
ShowCoverPageImage | true / false | true | Toggle to enable/disable the display of the cover page image |
ShowTableOfContents | true / false | true | Toggle to enable/disable table of contents |
ShowHeaderFooter | true / false | true | Toggle to enable/disable document headers & footers |
ShowTableCaptions | true / false | true | Toggle to enable/disable table captions/numbering |
The Options schema allows certain options within the report to be toggled on or off.
Sub-Schema | Setting | Default | Description |
---|---|---|---|
ShowDefinitionInfo | true/false | false | Toggle to enable/disable Microsoft AD term explanations |
PSDefaultAuthentication | Negotiate/Kerberos | Negotiate | Allow to set the value of the PSRemoting authentication method. For Workgroup authentication Negotiate value is required. |
ServerDiscovery | Domain/Standalone | Domain | Allow to set the DHCP servers discovery |
Exclude.Domains | Array List | Empty | Allow to filter on AD Domain FQDN |
Exclude.DCs | Array List | Empty | Allow to filter on AD Domain Controller Server FQDN. |
The InfoLevel schema allows configuration of each section of the report at a granular level. The following sections can be set.
There are 3 levels (0-2) of detail granularity for each section as follows;
Setting | InfoLevel | Description |
---|---|---|
0 | Disabled | Does not collect or display any information |
1 | Enabled / Summary | Provides summarised information for a collection of objects |
2 | Adv Summary | Provides condensed, detailed information for a collection of objects |
The table below outlines the default and maximum InfoLevel settings for each section.
Sub-Schema | Default Setting | Maximum Setting |
---|---|---|
DHCP | 1 | 2 |
The Healthcheck schema is used to toggle health checks on or off.
There are a few examples listed below on running the AsBuiltReport script against a Microsoft DHCP server target. Refer to the README.md
file in the main AsBuiltReport project repository for more examples.
# Generate a Microsoft DHCP As Built Report for DHCP Server 'admin-dhcp-01v.contoso.local' using specified credentials. Export report to HTML & DOCX formats. Use default report style. Append timestamp to report filename. Save reports to 'C:\Users\Jon\Documents'
PS C:\> New-AsBuiltReport -Report Microsoft.DHCP -Target 'admin-dhcp-01v.contoso.local' -Username '[email protected]' -Password 'P@ssw0rd' -Format Html,Word -OutputFolderPath 'C:\Users\Jon\Documents' -Timestamp
# Generate a Microsoft DHCP As Built Report for DHCP Server 'admin-dhcp-01v.contoso.local' using specified credentials and report configuration file. Export report to Text, HTML & DOCX formats. Use default report style. Save reports to 'C:\Users\Jon\Documents'. Display verbose messages to the console.
PS C:\> New-AsBuiltReport -Report Microsoft.DHCP -Target 'admin-dhcp-01v.contoso.local' -Username '[email protected]' -Password 'P@ssw0rd' -Format Text,Html,Word -OutputFolderPath 'C:\Users\Jon\Documents' -ReportConfigFilePath 'C:\Users\Jon\AsBuiltReport\AsBuiltReport.Microsoft.AD.json' -Verbose
# Generate a Microsoft DHCP As Built Report for DHCP Server 'admin-dhcp-01v.contoso.local' using stored credentials. Export report to HTML & Text formats. Use default report style. Highlight environment issues within the report. Save reports to 'C:\Users\Jon\Documents'.
PS C:\> $Creds = Get-Credential
PS C:\> New-AsBuiltReport -Report Microsoft.DHCP -Target 'admin-dhcp-01v.contoso.local' -Credential $Creds -Format Html,Text -OutputFolderPath 'C:\Users\Jon\Documents' -EnableHealthCheck
# Generate a Microsoft DHCP As Built Report for DHCP Server 'admin-dhcp-01v.contoso.local' using specified credentials. Export report to HTML & DOCX formats. Use default report style. Reports are saved to the user profile folder by default. Attach and send reports via e-mail.
PS C:\> New-AsBuiltReport -Report Microsoft.DHCP -Target 'admin-dhcp-01v.contoso.local' -Username '[email protected]' -Password 'P@ssw0rd' -Format Html,Word -OutputFolderPath 'C:\Users\Jon\Documents' -SendEmail
- Issues with WinRM when using the IP address instead of the "Fully Qualified Domain Name".
- This project relies heavily on the remote connection function through WinRM. For this reason the use of a Windows 10 client is specifically used as a jumpbox.
- This report document the DHCP server service Forest/Domain wide. If you need to document an standalone DHCP server the ServerDiscovery option must be set to Standalone.