-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
85cdf31
commit b85e344
Showing
25 changed files
with
907 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,11 @@ | |
}, | ||
"DNS": { | ||
"Aging": true | ||
}, | ||
"DHCP": { | ||
"Summary": true, | ||
"Credential": true, | ||
"Statistics": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {} | ||
|
||
} |
Oops, something went wrong.