Skip to content

Commit

Permalink
v0.3.0 release (#5)
Browse files Browse the repository at this point in the history
* Repository setup

* Update LICENSE

* Fix Release GitHub workflow

* v0.2.0 release (#1)

* Added per section InfoLevel and DC Diagnostic HealthCheck

* Added a function to convert bytes automatically to GB or TB based on size

* Added a function to convert true or false automatically to Yes or No. Hate Switch cases

* Added initial report structure

* Convert true or false output to yes or no

* Add Active Directory version support, Module Requirements and examples

* Fix forwrong false case

* Fix string output

* Update function name

* Add function with new name

* Update the functions to filter the content by Domain

* Update switch case

* Add Organization Unit reporting

* Pscribo Message fix

* Add site replication health check

* Fix created time format

* Add site links to the site report function

* Add site replication function

* Update funtion to better handle DC unavailable situations

* Add Site replication to the main report also fix InfoLevel

* Section Style Rename

* Add code to better handle unavailable DC Server

* Add Domain Controller Time Source Function also fix misc issues

* Added funtion to check AD Services status (DNS,NTP, NTDS etc)

* Add code to beter catch AD Domain issues

* Add support to Microsoft Active Directory Group Policy Objects information

* Update section heading text

* Add support to Microsoft AD Domain Name System Infrastructure information

* Add GPO support in Domain Section also added new DNS Section

* Add more healthcheck support

* update version to 0.2.0

* Add support for DNS Zone information

* Ensure support for PSv5.1+

* Update changelog with initial release features

* Updated Readme Module Requirements and installation examples

* Updated required permissions

* Update functions to use pssession

* Added more try\catch conditions also improve verbose/debug logging

* implement a shared function util file

* Added misc documentation

* Updated changelog for 0.2.0 changes

* Fix FQDN text

* Add more Examples

* Fix misc text

* More fixes

* Added Known Issues

* Added sample report

* The never ending fixes (Readme)

* Readme Fixes :(

* Readme example fixes

* requested recomendation

* Fix Release GitHub Workflow

- Add test for module manifest
- Add install of PSPKI module

* Added reference to WinRM requirements (#4)

* Added per section InfoLevel and DC Diagnostic HealthCheck

* Added a function to convert bytes automatically to GB or TB based on size

* Added a function to convert true or false automatically to Yes or No. Hate Switch cases

* Added initial report structure

* Convert true or false output to yes or no

* Add Active Directory version support, Module Requirements and examples

* Fix forwrong false case

* Fix string output

* Update function name

* Add function with new name

* Update the functions to filter the content by Domain

* Update switch case

* Add Organization Unit reporting

* Pscribo Message fix

* Add site replication health check

* Fix created time format

* Add site links to the site report function

* Add site replication function

* Update funtion to better handle DC unavailable situations

* Add Site replication to the main report also fix InfoLevel

* Section Style Rename

* Add code to better handle unavailable DC Server

* Add Domain Controller Time Source Function also fix misc issues

* Added funtion to check AD Services status (DNS,NTP, NTDS etc)

* Add code to beter catch AD Domain issues

* Add support to Microsoft Active Directory Group Policy Objects information

* Update section heading text

* Add support to Microsoft AD Domain Name System Infrastructure information

* Add GPO support in Domain Section also added new DNS Section

* Add more healthcheck support

* update version to 0.2.0

* Add support for DNS Zone information

* Ensure support for PSv5.1+

* Update changelog with initial release features

* Updated Readme Module Requirements and installation examples

* Updated required permissions

* Update functions to use pssession

* Added more try\catch conditions also improve verbose/debug logging

* implement a shared function util file

* Added misc documentation

* Updated changelog for 0.2.0 changes

* Fix FQDN text

* Add more Examples

* Fix misc text

* More fixes

* Added Known Issues

* Added sample report

* The never ending fixes (Readme)

* Readme Fixes :(

* Readme example fixes

* requested recomendation

* Added DHCP Server Section

* Fix for PSSession exhaustion

* Minot text fix & Error message catching

* Fix duplicate pssession error

* Fix for unhandle null values

* Fix for PSSession exhaustion also added DHCP main section

* Added more dhcp sections

* Added Heading6 to the document style

* Fix for heading hierarchy

* Fix schema version code

* Added funtion to convert from subnetmask to dotted notation

* Added definition paragraph also fix heading hierarchy

* Added Heading 7 definition

* Updated ActiveDirectory RequiredModules fix bug on issues #3

* Updated section Title

* Added IPv4/IPv6 Scope section

* Added better error message

* Fix IPaddress colums

* Update version to 0.3.0

* Fix lease duration unlimited case

* Update to release version 0.3.0

* Added reference to WinRM requirements

Co-authored-by: Tim Carman <[email protected]>

* Update manifest

Co-authored-by: Jonathan Colon <[email protected]>
Co-authored-by: Jonathan Colon <[email protected]>
  • Loading branch information
3 people committed Sep 27, 2021
1 parent 85cdf31 commit b85e344
Show file tree
Hide file tree
Showing 25 changed files with 907 additions and 173 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
publish-to-gallery:
runs-on: ubuntu-latest
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Set PSRepository to Trusted for PowerShell Gallery
Expand All @@ -17,6 +17,14 @@ jobs:
shell: pwsh
run: |
Install-Module -Name AsBuiltReport.Core -Repository PSGallery -Force
- name: Install PSPKI module
shell: pwsh
run: |
Install-Module -Name PSPKI -Repository PSGallery -Force
- name: Test Module Manifest
shell: pwsh
run: |
Test-ModuleManifest .\AsBuiltReport.Microsoft.AD.psd1
- name: Publish module to PowerShell Gallery
shell: pwsh
run: |
Expand Down
10 changes: 6 additions & 4 deletions AsBuiltReport.Microsoft.AD.Style.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ Style -Name 'Title' -Size 24 -Color '737373' -Align Center
Style -Name 'Title 2' -Size 18 -Color '00A4EF' -Align Center
Style -Name 'Title 3' -Size 12 -Color '00A4EF' -Align Left
Style -Name 'Heading 1' -Size 16 -Color '00A4EF'
Style -Name 'Heading 2' -Size 14 -Color '00A4EF'
Style -Name 'Heading 3' -Size 12 -Color '00A4EF'
Style -Name 'Heading 4' -Size 11 -Color '00A4EF'
Style -Name 'Heading 5' -Size 10 -Color '00A4EF'
Style -Name 'Heading 2' -Size 15 -Color '00A4EF'
Style -Name 'Heading 3' -Size 14 -Color '00A4EF'
Style -Name 'Heading 4' -Size 13 -Color '00A4EF'
Style -Name 'Heading 5' -Size 12 -Color '00A4EF'
Style -Name 'Heading 6' -Size 11 -Color '00A4EF'
Style -Name 'Heading 7' -Size 10 -Color '00A4EF'
Style -Name 'Normal' -Size 10 -Color '565656' -Default
Style -Name 'Caption' -Size 10 -Color '565656' -Italic -Align Center
Style -Name 'Header' -Size 10 -Color '565656' -Align Center
Expand Down
5 changes: 5 additions & 0 deletions AsBuiltReport.Microsoft.AD.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
},
"DNS": {
"Aging": true
},
"DHCP": {
"Summary": true,
"Credential": true,
"Statistics": true
}
}
}
8 changes: 2 additions & 6 deletions AsBuiltReport.Microsoft.AD.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AsBuiltReport.Microsoft.AD.psm1'

# Version number of this module.
ModuleVersion = '0.2.0'
ModuleVersion = '0.3.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -56,10 +56,6 @@ RequiredModules = @(
ModuleName = 'AsBuiltReport.Core';
ModuleVersion = '1.1.0'
},
@{
ModuleName = 'ActiveDirectory';
ModuleVersion = '1.0'
},
@{
ModuleName = 'PSPKI';
ModuleVersion = '3.7.2'
Expand Down Expand Up @@ -108,7 +104,7 @@ PrivateData = @{
PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = 'AsBuiltReport', 'Report', 'Microsoft', 'AD', 'Active-Directory', 'Documentation', 'PScribo', 'PSEdition_Desktop', 'PSEdition_Core', 'Windows', 'MacOS', 'Linux'
Tags = 'AsBuiltReport', 'Report', 'Microsoft', 'AD', 'Active-Directory', 'Documentation', 'PScribo', 'PSEdition_Desktop', 'PSEdition_Core', 'Windows'

# A URL to the license for this module.
LicenseUri = 'https://raw.githubusercontent.com/AsBuiltReport/AsBuiltReport.Microsoft.AD/master/LICENSE'
Expand Down
85 changes: 68 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,88 @@
# :arrows_counterclockwise: Microsoft AD As Built Report Changelog

## [0.3.0] - 2021-09-26

### Added

- Added Active Directory DHCP summary information.
- Added DHCP Database information.
- Added DHCP Dynamic DNS information.
- Added per Domain DHCP IPv4 Scope information.
- Added DHCP Scope Failover configuration information.
- Added DHCP Scope Statistics information.
- Added DHCP Scope Interface Binding information.
- Added DHCP Scope Delegation configuration information.
- Added per Domain DHCP IPv6 Scope information.
- Added DHCP Scope Failover configuration information.
- Added DHCP Scope Statistics information.
- Added DHCP Scope Interface Binding information.
- Added DHCP health check.

### Changed

- Added more Heading definitions.
- Added funtion to convert from subnetmask to dotted notation.
- Added a function to convert empty culumns to "-" (less switch cases).

### Fixed

- Fix for PSSession exhaustion.
- Fix for DNS Zone Delegation IPaddress variable
- Fix for unhandle null values.
- Enhanced error message catching.
- Fix for heading hierarchy.
- Fix Forest schema version code.
- Fix ActiveDirectory RequiredModule error (Fix [#3](https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.AD/issues/3)).

## [0.2.0] - 2021-09-10

### Added

- Added Active Directory DNS summary information
- Added DNS Forwarder summary information
- Added Added DNS Recursion configuration information
- Added Added DNS RRL configuration information
- Added Added DNS Zone Reverse Lookup configuration information
- Added Added DNS Zone Scavenging/Aging configuration information
- Added Added DNS Zone Delegation configuration information
- Added more health checks
- Added Active Directory DNS summary information.
- Added DNS Forwarder summary information.
- Added DNS Recursion configuration information.
- Added DNS RRL configuration information.
- Added DNS Zone Reverse Lookup configuration information.
- Added DNS Zone Scavenging/Aging configuration information.
- Added DNS Zone Delegation configuration information.
- Added more health checks.

### Changed

- Improved per Domain configuration information
- Improved per Domain Controller configuration information
- Introduced the ability to use a shared PSsession
- Merged the functions used within the reports into a single file (SharedUtilsFunctions)
- Improved per Domain configuration information.
- Improved per Domain Controller configuration information.
- Introduced the ability to use a shared PSsession.
- Merged the functions used within the reports into a single file (SharedUtilsFunctions).

### Fixed

- Enhanced the logic of detecting a unavailable Domain or DC.
- Enhanced verbose/degug logging
- Added more try/catch code to improve error diagnostic
- Enhanced verbose/degug logging.
- Added more try/catch code to improve error diagnostic.

## [0.1.0] - 2021-08-10

### Added

- Added Active Directory Forest summary information
- Added Forest Optional Features Summary
- Added Active Directory Forest summary information.
- Added Forest Optional Features Summary.
- Added Domain Site summary information.
- Added Domain Site Link summary information.
- Added Active Directory Domain summary Infomation.
- Added Object Count summary Information.
- Added Default Domain Password Policy Summary Information.
- Added Group Managed Service Accounts (GMSA) Summary Information.
- Added Flexible Single Master Operations (FSMO) Information.
- Added Trust Summary information.
- Added Domain Controller Information.
- Added Domain Controller Hardware Summary.
- Added Domain Controller NTDS Summary.
- Added Domain Controller Time Source Summary.
- Added Domain Controller Infrastructure Services Status.
- Added Site Replication Summary.
- Added Site Replication Failure Summary.
- Added Group Policy Objects Summary.
- Added Organizational Unit summary.
- Added Domain Site summary information
- Added Domain Site Link summary information
- Added Active Directory Domain summary Infomation
Expand All @@ -48,4 +99,4 @@
- Added Site Replication Summary
- Added Site Replication Failure Summary
- Added Group Policy Objects Summary
- Added Organizational Unit summary
- Added Organizational Unit summary
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ This report does not support Linux or Mac due to the fact that the ActiveDirecto

### :closed_lock_with_key: Required Privileges

A Microsoft AD As Built Report can be generated with Active Directory Enterprise Forest level privileges. Due to the limitations of the WinRM protocol, a domain-joined machine is needed, also it is required to use the FQDN of the DC instead of its IP address.
A Microsoft AD As Built Report can be generated with Active Directory Enterprise Forest level privileges. Since this report relies extensively on the WinRM component, you should make sure that it is enabled and configured. [Reference](https://docs.microsoft.com/en-us/windows/win32/winrm/installation-and-configuration-for-windows-remote-management)

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](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_remote_troubleshooting?view=powershell-7.1#how-to-use-an-ip-address-in-a-remote-command)

## :package: Module Installation
Expand Down
2 changes: 1 addition & 1 deletion Src/Private/Get-AbrADDCDiag.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-AbrADDCDiag {
.DESCRIPTION
.NOTES
Version: 0.2.0
Version: 0.3.0
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand Down
158 changes: 158 additions & 0 deletions Src/Private/Get-AbrADDHCPInfrastructure.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
function Get-AbrADDHCPInfrastructure {
<#
.SYNOPSIS
Used by As Built Report to retrieve Microsoft AD DHCP Servers from Domain Controller
.DESCRIPTION
.NOTES
Version: 0.3.0
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
.EXAMPLE
.LINK
#>
[CmdletBinding()]
param (
[Parameter (
Position = 0,
Mandatory)]
[string]
$Domain,
$Session,
[PSCredential]
$Cred
)

begin {
Write-PscriboMessage "Discovering Active Directory DHCP Servers information on $($Domain.ToString().ToUpper())."
}

process {
Section -Style Heading5 'DHCP Servers In Active Directory Summary' {
Paragraph "The following section provides a summary of the DHCP servers information on $($Domain.ToString().ToUpper())."
BlankLine
$OutObj = @()
if ($Domain) {
try {
$DHCPinDC = Invoke-Command -Session $Session { Get-DhcpServerInDC | Where-Object {$_.DnsName.split(".", 2)[1] -eq $using:Domain} }
if ($DHCPinDC) {Write-PScriboMessage "Discovered '$(($DHCPinDC | Measure-Object).Count)' DHCP Servers in forest $($Domain)."}
foreach ($DHCPServers in $DHCPinDC) {
Write-PScriboMessage "Collecting DHCP Server Setting information from $($DHCPServers.DnsName.split(".", 2)[0])"
$Setting = Invoke-Command -Session $Session { Get-DhcpServerSetting -ComputerName ($using:DHCPServers).DnsName }
$inObj = [ordered] @{
'DC Name' = $DHCPServers.DnsName.Split(".", 2)[0]
'IP Address' = $DHCPServers.IPAddress
'Domain Name' = $DHCPServers.DnsName.Split(".", 2)[1]
'Domain Joined' = ConvertTo-TextYN $Setting.IsDomainJoined
'Authorized' = ConvertTo-TextYN $Setting.IsAuthorized
'Conflict Detection Attempts' = ConvertTo-TextYN $Setting.ConflictDetectionAttempts
}
$OutObj += [pscustomobject]$inobj
}
}
catch {
Write-PScriboMessage -IsWarning "Error: Retreiving Dhcp Server Setting from $($DHCPServers.DnsName.Split(".", 2)[0])."
Write-PScriboMessage -IsDebug $_.Exception.Message
}
}

$TableParams = @{
Name = "DHCP Servers In Active Directory Information - $($Domain.ToString().ToUpper())"
List = $false
ColumnWidths = 20, 15, 20, 15, 15 ,15
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$OutObj | Table @TableParams
Section -Style Heading6 'Service Database Summary' {
Paragraph "The following section provides a summary of the DHCP servers service database information on $($Domain.ToString().ToUpper())."
BlankLine
$OutObj = @()
if ($Domain) {
try {
Write-PscriboMessage "Discovering Active Directory DHCP Servers information on $($Domain)."
$DHCPinDC = Invoke-Command -Session $Session { Get-DhcpServerInDC | Where-Object {$_.DnsName.split(".", 2)[1] -eq $using:Domain} }
if ($DHCPinDC) {Write-PScriboMessage "Discovered '$(($DHCPinDC | Measure-Object).Count)' DHCP Servers in forest $($Domain)."}
foreach ($DHCPServers in $DHCPinDC) {
Write-PScriboMessage "Collecting DHCP Server database information from $($DHCPServers.DnsName.split(".", 2)[0])"
$Setting = Invoke-Command -Session $Session { Get-DhcpServerDatabase -ComputerName ($using:DHCPServers).DnsName }
$inObj = [ordered] @{
'DC Name' = $DHCPServers.DnsName.Split(".", 2)[0]
'File Path' = ConvertTo-EmptyToFiller $Setting.FileName
'Backup Path' = ConvertTo-EmptyToFiller $Setting.BackupPath
'Backup Interval' = switch ($Setting.BackupInterval) {
"" {"-"; break}
$NULL {"-"; break}
default {"$($Setting.BackupInterval) min"}
}
'Logging Enabled' = Switch ($Setting.LoggingEnabled) {
"" {"-"; break}
$Null {"-"; break}
default {ConvertTo-TextYN $Setting.LoggingEnabled}
}
}
$OutObj += [pscustomobject]$inobj
}
}
catch {
Write-PScriboMessage -IsWarning "Error: Retreiving Dhcp Servers Database on $($DHCPServers.DnsName)."
Write-PScriboMessage -IsDebug $_.Exception.Message
}
}

$TableParams = @{
Name = "DHCP Servers Database Information - $($Domain.ToString().ToUpper())"
List = $false
ColumnWidths = 20, 28, 28, 12, 12
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$OutObj | Table @TableParams
}
Section -Style Heading6 'Dynamic DNS credentials Summary' {
Paragraph "The following section provides a summary of the DHCP Servers Dynamic DNS registration credentials information on $($Domain.ToString().ToUpper())."
BlankLine
$OutObj = @()
if ($Domain) {
try {
Write-PscriboMessage "Discovering Active Directory DHCP Servers information on $($Domain)."
$DHCPinDC = Invoke-Command -Session $Session { Get-DhcpServerInDC | Where-Object {$_.DnsName.split(".", 2)[1] -eq $using:Domain} }
if ($DHCPinDC) {Write-PScriboMessage "Discovered '$(($DHCPinDC | Measure-Object).Count)' DHCP Servers in forest $($Domain)."}
foreach ($DHCPServers in $DHCPinDC) {
Write-PScriboMessage "Collecting DHCP Server Dynamic DNS Credentials information from $($DHCPServers.DnsName.split(".", 2)[0])"
$Setting = Invoke-Command -Session $Session { Get-DhcpServerDnsCredential -ComputerName ($using:DHCPServers).DnsName }
$inObj = [ordered] @{
'DC Name' = $DHCPServers.DnsName.Split(".", 2)[0]
'User Name' = ConvertTo-EmptyToFiller $Setting.UserName
'Domain Name' = ConvertTo-EmptyToFiller $Setting.DomainName
}
$OutObj += [pscustomobject]$inobj
}
}
catch {
Write-PScriboMessage -IsWarning "Error: Retreiving Dhcp Servers Dynamic DNS credentials on $($DHCPServers.DnsName)."
Write-PScriboMessage -IsDebug $_.Exception.Message
}
}

$TableParams = @{
Name = "DHCP Servers Dynamic DNS Credentials Information - $($Domain.ToString().ToUpper())"
List = $false
ColumnWidths = 30, 30, 40
}
if ($Report.ShowTableCaptions) {
$TableParams['Caption'] = "- $($TableParams.Name)"
}
$OutObj | Table @TableParams
}
}
}

end {}

}
Loading

0 comments on commit b85e344

Please sign in to comment.