Skip to content

Commit

Permalink
Zone Transfer section displaying an empty table. AsBuiltReport#178
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelinux committed Jun 13, 2024
1 parent 3070106 commit 1b84e9f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Src/Private/Get-AbrADDNSZone.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function Get-AbrADDNSZone {
.DESCRIPTION
.NOTES
Version: 0.8.1
Version: 0.8.2
Author: Jonathan Colon
Twitter: @jcolonfzenpr
Github: rebelinux
Expand All @@ -31,6 +31,7 @@ function Get-AbrADDNSZone {

process {
try {
$DCPssSession = New-PSSession $DC -Credential $Credential -Authentication $Options.PSDefaultAuthentication -Name 'DDNSInfrastructure'
$DNSSetting = Get-DnsServerZone -CimSession $TempCIMSession -ComputerName $DC | Where-Object { $_.IsReverseLookupZone -like "False" -and $_.ZoneType -notlike "Forwarder" }
if ($DNSSetting) {
Section -Style Heading3 "$($DC.ToString().ToUpper().Split(".")[0]) DNS Zones" {
Expand Down Expand Up @@ -115,7 +116,11 @@ function Get-AbrADDNSZone {

if ($InfoLevel.DNS -ge 2) {
try {
$DNSSetting = Invoke-Command -Session $DCPssSession { Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DNS Server\Zones\*" | Get-ItemProperty | Where-Object { $_ -match 'SecondaryServers' } }
$DNSSetting = $Null
if ($DCPssSession) {
$DNSSetting = Invoke-Command -Session $DCPssSession { Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DNS Server\Zones\*" | Get-ItemProperty | Where-Object { $_ -match 'SecondaryServers' } }
Remove-PSSession -Session $DCPssSession
}
if ($DNSSetting) {
Section -Style Heading4 "Zone Transfers" {
$OutObj = @()
Expand Down Expand Up @@ -298,7 +303,6 @@ function Get-AbrADDNSZone {
}
}
}
Remove-PSSession -Session $DCPssSession
} catch {
Write-PScriboMessage -IsWarning "$($_.Exception.Message) (Global DNS Zone Information)"
}
Expand Down

0 comments on commit 1b84e9f

Please sign in to comment.