Skip to content

Commit

Permalink
Improved DC exclude logic
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelinux committed Feb 24, 2024
1 parent 68ee3fd commit 18e7a56
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Src/Private/Get-AbrDomainSection.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function Get-AbrDomainSection {
if ($DCStatus -eq $false) {
Write-PScriboMessage -IsWarning "Unable to connect to $DC. Removing it from the $Domain report"
}
if (($DC -notin $Options.Exclude.DCs) -and $DCStatus) {
if ($DCStatus) {
Get-AbrADDCRoleFeature -DC $DC
}
}
Expand All @@ -104,7 +104,7 @@ function Get-AbrDomainSection {
Paragraph "The following section provides a summary of the Active Directory DC Diagnostic."
BlankLine
foreach ($DC in $DCs) {
if (($DC -notin $Options.Exclude.DCs) -and (Test-Connection -ComputerName $DC -Quiet -Count 2)) {
if (Test-Connection -ComputerName $DC -Quiet -Count 2) {
Get-AbrADDCDiag -Domain $Domain -DC $DC
}
}
Expand All @@ -118,7 +118,7 @@ function Get-AbrDomainSection {
Section -Style Heading4 "Infrastructure Services" {
Paragraph "The following section provides a summary of the Domain Controller Infrastructure services status."
foreach ($DC in $DCs) {
if (($DC -notin $Options.Exclude.DCs) -and (Test-Connection -ComputerName $DC -Quiet -Count 2)) {
if (Test-Connection -ComputerName $DC -Quiet -Count 2) {
Get-AbrADInfrastructureService -DC $DC
}
}
Expand Down

0 comments on commit 18e7a56

Please sign in to comment.