Skip to content

Commit b85e344

Browse files
tpcarmanrebelinux
andauthored
v0.3.0 release (#5)
* 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 <tpcarman@gmail.com> * Update manifest Co-authored-by: Jonathan Colon <rebelinux@gmail.com> Co-authored-by: Jonathan Colon <jcolonf@zenprsolutions.com>
1 parent 85cdf31 commit b85e344

25 files changed

+907
-173
lines changed

.github/workflows/Release.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
publish-to-gallery:
9-
runs-on: ubuntu-latest
9+
runs-on: windows-2019
1010
steps:
1111
- uses: actions/checkout@v2
1212
- name: Set PSRepository to Trusted for PowerShell Gallery
@@ -17,6 +17,14 @@ jobs:
1717
shell: pwsh
1818
run: |
1919
Install-Module -Name AsBuiltReport.Core -Repository PSGallery -Force
20+
- name: Install PSPKI module
21+
shell: pwsh
22+
run: |
23+
Install-Module -Name PSPKI -Repository PSGallery -Force
24+
- name: Test Module Manifest
25+
shell: pwsh
26+
run: |
27+
Test-ModuleManifest .\AsBuiltReport.Microsoft.AD.psd1
2028
- name: Publish module to PowerShell Gallery
2129
shell: pwsh
2230
run: |

AsBuiltReport.Microsoft.AD.Style.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ Style -Name 'Title' -Size 24 -Color '737373' -Align Center
88
Style -Name 'Title 2' -Size 18 -Color '00A4EF' -Align Center
99
Style -Name 'Title 3' -Size 12 -Color '00A4EF' -Align Left
1010
Style -Name 'Heading 1' -Size 16 -Color '00A4EF'
11-
Style -Name 'Heading 2' -Size 14 -Color '00A4EF'
12-
Style -Name 'Heading 3' -Size 12 -Color '00A4EF'
13-
Style -Name 'Heading 4' -Size 11 -Color '00A4EF'
14-
Style -Name 'Heading 5' -Size 10 -Color '00A4EF'
11+
Style -Name 'Heading 2' -Size 15 -Color '00A4EF'
12+
Style -Name 'Heading 3' -Size 14 -Color '00A4EF'
13+
Style -Name 'Heading 4' -Size 13 -Color '00A4EF'
14+
Style -Name 'Heading 5' -Size 12 -Color '00A4EF'
15+
Style -Name 'Heading 6' -Size 11 -Color '00A4EF'
16+
Style -Name 'Heading 7' -Size 10 -Color '00A4EF'
1517
Style -Name 'Normal' -Size 10 -Color '565656' -Default
1618
Style -Name 'Caption' -Size 10 -Color '565656' -Italic -Align Center
1719
Style -Name 'Header' -Size 10 -Color '565656' -Align Center

AsBuiltReport.Microsoft.AD.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
},
3434
"DNS": {
3535
"Aging": true
36+
},
37+
"DHCP": {
38+
"Summary": true,
39+
"Credential": true,
40+
"Statistics": true
3641
}
3742
}
3843
}

AsBuiltReport.Microsoft.AD.psd1

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'AsBuiltReport.Microsoft.AD.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.2.0'
15+
ModuleVersion = '0.3.0'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
@@ -56,10 +56,6 @@ RequiredModules = @(
5656
ModuleName = 'AsBuiltReport.Core';
5757
ModuleVersion = '1.1.0'
5858
},
59-
@{
60-
ModuleName = 'ActiveDirectory';
61-
ModuleVersion = '1.0'
62-
},
6359
@{
6460
ModuleName = 'PSPKI';
6561
ModuleVersion = '3.7.2'
@@ -108,7 +104,7 @@ PrivateData = @{
108104
PSData = @{
109105

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

113109
# A URL to the license for this module.
114110
LicenseUri = 'https://raw.githubusercontent.com/AsBuiltReport/AsBuiltReport.Microsoft.AD/master/LICENSE'

CHANGELOG.md

Lines changed: 68 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,88 @@
11
# :arrows_counterclockwise: Microsoft AD As Built Report Changelog
22

3+
## [0.3.0] - 2021-09-26
4+
5+
### Added
6+
7+
- Added Active Directory DHCP summary information.
8+
- Added DHCP Database information.
9+
- Added DHCP Dynamic DNS information.
10+
- Added per Domain DHCP IPv4 Scope information.
11+
- Added DHCP Scope Failover configuration information.
12+
- Added DHCP Scope Statistics information.
13+
- Added DHCP Scope Interface Binding information.
14+
- Added DHCP Scope Delegation configuration information.
15+
- Added per Domain DHCP IPv6 Scope information.
16+
- Added DHCP Scope Failover configuration information.
17+
- Added DHCP Scope Statistics information.
18+
- Added DHCP Scope Interface Binding information.
19+
- Added DHCP health check.
20+
21+
### Changed
22+
23+
- Added more Heading definitions.
24+
- Added funtion to convert from subnetmask to dotted notation.
25+
- Added a function to convert empty culumns to "-" (less switch cases).
26+
27+
### Fixed
28+
29+
- Fix for PSSession exhaustion.
30+
- Fix for DNS Zone Delegation IPaddress variable
31+
- Fix for unhandle null values.
32+
- Enhanced error message catching.
33+
- Fix for heading hierarchy.
34+
- Fix Forest schema version code.
35+
- Fix ActiveDirectory RequiredModule error (Fix [#3](https://github.com/AsBuiltReport/AsBuiltReport.Microsoft.AD/issues/3)).
36+
337
## [0.2.0] - 2021-09-10
438

539
### Added
640

7-
- Added Active Directory DNS summary information
8-
- Added DNS Forwarder summary information
9-
- Added Added DNS Recursion configuration information
10-
- Added Added DNS RRL configuration information
11-
- Added Added DNS Zone Reverse Lookup configuration information
12-
- Added Added DNS Zone Scavenging/Aging configuration information
13-
- Added Added DNS Zone Delegation configuration information
14-
- Added more health checks
41+
- Added Active Directory DNS summary information.
42+
- Added DNS Forwarder summary information.
43+
- Added DNS Recursion configuration information.
44+
- Added DNS RRL configuration information.
45+
- Added DNS Zone Reverse Lookup configuration information.
46+
- Added DNS Zone Scavenging/Aging configuration information.
47+
- Added DNS Zone Delegation configuration information.
48+
- Added more health checks.
1549

1650
### Changed
1751

18-
- Improved per Domain configuration information
19-
- Improved per Domain Controller configuration information
20-
- Introduced the ability to use a shared PSsession
21-
- Merged the functions used within the reports into a single file (SharedUtilsFunctions)
52+
- Improved per Domain configuration information.
53+
- Improved per Domain Controller configuration information.
54+
- Introduced the ability to use a shared PSsession.
55+
- Merged the functions used within the reports into a single file (SharedUtilsFunctions).
2256

2357
### Fixed
2458

2559
- Enhanced the logic of detecting a unavailable Domain or DC.
26-
- Enhanced verbose/degug logging
27-
- Added more try/catch code to improve error diagnostic
60+
- Enhanced verbose/degug logging.
61+
- Added more try/catch code to improve error diagnostic.
2862

2963
## [0.1.0] - 2021-08-10
3064

3165
### Added
3266

33-
- Added Active Directory Forest summary information
34-
- Added Forest Optional Features Summary
67+
- Added Active Directory Forest summary information.
68+
- Added Forest Optional Features Summary.
69+
- Added Domain Site summary information.
70+
- Added Domain Site Link summary information.
71+
- Added Active Directory Domain summary Infomation.
72+
- Added Object Count summary Information.
73+
- Added Default Domain Password Policy Summary Information.
74+
- Added Group Managed Service Accounts (GMSA) Summary Information.
75+
- Added Flexible Single Master Operations (FSMO) Information.
76+
- Added Trust Summary information.
77+
- Added Domain Controller Information.
78+
- Added Domain Controller Hardware Summary.
79+
- Added Domain Controller NTDS Summary.
80+
- Added Domain Controller Time Source Summary.
81+
- Added Domain Controller Infrastructure Services Status.
82+
- Added Site Replication Summary.
83+
- Added Site Replication Failure Summary.
84+
- Added Group Policy Objects Summary.
85+
- Added Organizational Unit summary.
3586
- Added Domain Site summary information
3687
- Added Domain Site Link summary information
3788
- Added Active Directory Domain summary Infomation
@@ -48,4 +99,4 @@
4899
- Added Site Replication Summary
49100
- Added Site Replication Failure Summary
50101
- Added Group Policy Objects Summary
51-
- Added Organizational Unit summary
102+
- Added Organizational Unit summary

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ This report does not support Linux or Mac due to the fact that the ActiveDirecto
6767

6868
### :closed_lock_with_key: Required Privileges
6969

70-
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.
70+
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)
71+
72+
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.
7173
[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)
7274

7375
## :package: Module Installation

Src/Private/Get-AbrADDCDiag.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function Get-AbrADDCDiag {
55
.DESCRIPTION
66
77
.NOTES
8-
Version: 0.2.0
8+
Version: 0.3.0
99
Author: Jonathan Colon
1010
Twitter: @jcolonfzenpr
1111
Github: rebelinux
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
function Get-AbrADDHCPInfrastructure {
2+
<#
3+
.SYNOPSIS
4+
Used by As Built Report to retrieve Microsoft AD DHCP Servers from Domain Controller
5+
.DESCRIPTION
6+
7+
.NOTES
8+
Version: 0.3.0
9+
Author: Jonathan Colon
10+
Twitter: @jcolonfzenpr
11+
Github: rebelinux
12+
.EXAMPLE
13+
14+
.LINK
15+
16+
#>
17+
[CmdletBinding()]
18+
param (
19+
[Parameter (
20+
Position = 0,
21+
Mandatory)]
22+
[string]
23+
$Domain,
24+
$Session,
25+
[PSCredential]
26+
$Cred
27+
)
28+
29+
begin {
30+
Write-PscriboMessage "Discovering Active Directory DHCP Servers information on $($Domain.ToString().ToUpper())."
31+
}
32+
33+
process {
34+
Section -Style Heading5 'DHCP Servers In Active Directory Summary' {
35+
Paragraph "The following section provides a summary of the DHCP servers information on $($Domain.ToString().ToUpper())."
36+
BlankLine
37+
$OutObj = @()
38+
if ($Domain) {
39+
try {
40+
$DHCPinDC = Invoke-Command -Session $Session { Get-DhcpServerInDC | Where-Object {$_.DnsName.split(".", 2)[1] -eq $using:Domain} }
41+
if ($DHCPinDC) {Write-PScriboMessage "Discovered '$(($DHCPinDC | Measure-Object).Count)' DHCP Servers in forest $($Domain)."}
42+
foreach ($DHCPServers in $DHCPinDC) {
43+
Write-PScriboMessage "Collecting DHCP Server Setting information from $($DHCPServers.DnsName.split(".", 2)[0])"
44+
$Setting = Invoke-Command -Session $Session { Get-DhcpServerSetting -ComputerName ($using:DHCPServers).DnsName }
45+
$inObj = [ordered] @{
46+
'DC Name' = $DHCPServers.DnsName.Split(".", 2)[0]
47+
'IP Address' = $DHCPServers.IPAddress
48+
'Domain Name' = $DHCPServers.DnsName.Split(".", 2)[1]
49+
'Domain Joined' = ConvertTo-TextYN $Setting.IsDomainJoined
50+
'Authorized' = ConvertTo-TextYN $Setting.IsAuthorized
51+
'Conflict Detection Attempts' = ConvertTo-TextYN $Setting.ConflictDetectionAttempts
52+
}
53+
$OutObj += [pscustomobject]$inobj
54+
}
55+
}
56+
catch {
57+
Write-PScriboMessage -IsWarning "Error: Retreiving Dhcp Server Setting from $($DHCPServers.DnsName.Split(".", 2)[0])."
58+
Write-PScriboMessage -IsDebug $_.Exception.Message
59+
}
60+
}
61+
62+
$TableParams = @{
63+
Name = "DHCP Servers In Active Directory Information - $($Domain.ToString().ToUpper())"
64+
List = $false
65+
ColumnWidths = 20, 15, 20, 15, 15 ,15
66+
}
67+
if ($Report.ShowTableCaptions) {
68+
$TableParams['Caption'] = "- $($TableParams.Name)"
69+
}
70+
$OutObj | Table @TableParams
71+
Section -Style Heading6 'Service Database Summary' {
72+
Paragraph "The following section provides a summary of the DHCP servers service database information on $($Domain.ToString().ToUpper())."
73+
BlankLine
74+
$OutObj = @()
75+
if ($Domain) {
76+
try {
77+
Write-PscriboMessage "Discovering Active Directory DHCP Servers information on $($Domain)."
78+
$DHCPinDC = Invoke-Command -Session $Session { Get-DhcpServerInDC | Where-Object {$_.DnsName.split(".", 2)[1] -eq $using:Domain} }
79+
if ($DHCPinDC) {Write-PScriboMessage "Discovered '$(($DHCPinDC | Measure-Object).Count)' DHCP Servers in forest $($Domain)."}
80+
foreach ($DHCPServers in $DHCPinDC) {
81+
Write-PScriboMessage "Collecting DHCP Server database information from $($DHCPServers.DnsName.split(".", 2)[0])"
82+
$Setting = Invoke-Command -Session $Session { Get-DhcpServerDatabase -ComputerName ($using:DHCPServers).DnsName }
83+
$inObj = [ordered] @{
84+
'DC Name' = $DHCPServers.DnsName.Split(".", 2)[0]
85+
'File Path' = ConvertTo-EmptyToFiller $Setting.FileName
86+
'Backup Path' = ConvertTo-EmptyToFiller $Setting.BackupPath
87+
'Backup Interval' = switch ($Setting.BackupInterval) {
88+
"" {"-"; break}
89+
$NULL {"-"; break}
90+
default {"$($Setting.BackupInterval) min"}
91+
}
92+
'Logging Enabled' = Switch ($Setting.LoggingEnabled) {
93+
"" {"-"; break}
94+
$Null {"-"; break}
95+
default {ConvertTo-TextYN $Setting.LoggingEnabled}
96+
}
97+
}
98+
$OutObj += [pscustomobject]$inobj
99+
}
100+
}
101+
catch {
102+
Write-PScriboMessage -IsWarning "Error: Retreiving Dhcp Servers Database on $($DHCPServers.DnsName)."
103+
Write-PScriboMessage -IsDebug $_.Exception.Message
104+
}
105+
}
106+
107+
$TableParams = @{
108+
Name = "DHCP Servers Database Information - $($Domain.ToString().ToUpper())"
109+
List = $false
110+
ColumnWidths = 20, 28, 28, 12, 12
111+
}
112+
if ($Report.ShowTableCaptions) {
113+
$TableParams['Caption'] = "- $($TableParams.Name)"
114+
}
115+
$OutObj | Table @TableParams
116+
}
117+
Section -Style Heading6 'Dynamic DNS credentials Summary' {
118+
Paragraph "The following section provides a summary of the DHCP Servers Dynamic DNS registration credentials information on $($Domain.ToString().ToUpper())."
119+
BlankLine
120+
$OutObj = @()
121+
if ($Domain) {
122+
try {
123+
Write-PscriboMessage "Discovering Active Directory DHCP Servers information on $($Domain)."
124+
$DHCPinDC = Invoke-Command -Session $Session { Get-DhcpServerInDC | Where-Object {$_.DnsName.split(".", 2)[1] -eq $using:Domain} }
125+
if ($DHCPinDC) {Write-PScriboMessage "Discovered '$(($DHCPinDC | Measure-Object).Count)' DHCP Servers in forest $($Domain)."}
126+
foreach ($DHCPServers in $DHCPinDC) {
127+
Write-PScriboMessage "Collecting DHCP Server Dynamic DNS Credentials information from $($DHCPServers.DnsName.split(".", 2)[0])"
128+
$Setting = Invoke-Command -Session $Session { Get-DhcpServerDnsCredential -ComputerName ($using:DHCPServers).DnsName }
129+
$inObj = [ordered] @{
130+
'DC Name' = $DHCPServers.DnsName.Split(".", 2)[0]
131+
'User Name' = ConvertTo-EmptyToFiller $Setting.UserName
132+
'Domain Name' = ConvertTo-EmptyToFiller $Setting.DomainName
133+
}
134+
$OutObj += [pscustomobject]$inobj
135+
}
136+
}
137+
catch {
138+
Write-PScriboMessage -IsWarning "Error: Retreiving Dhcp Servers Dynamic DNS credentials on $($DHCPServers.DnsName)."
139+
Write-PScriboMessage -IsDebug $_.Exception.Message
140+
}
141+
}
142+
143+
$TableParams = @{
144+
Name = "DHCP Servers Dynamic DNS Credentials Information - $($Domain.ToString().ToUpper())"
145+
List = $false
146+
ColumnWidths = 30, 30, 40
147+
}
148+
if ($Report.ShowTableCaptions) {
149+
$TableParams['Caption'] = "- $($TableParams.Name)"
150+
}
151+
$OutObj | Table @TableParams
152+
}
153+
}
154+
}
155+
156+
end {}
157+
158+
}

0 commit comments

Comments
 (0)