Skip to content

Commit

Permalink
Merge pull request #2272 from microsoft/ShasagarUpdated-HCIISBindings…
Browse files Browse the repository at this point in the history
…Check

Update Invoke-AnalyzerIISInformation.ps1 to verify Exchange Back End website binding [Issue #2209]
  • Loading branch information
dpaulson45 authored Jan 22, 2025
2 parents 877d115 + 24dd1d5 commit 7dd28f5
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function Invoke-AnalyzerIISInformation {
Write-Verbose "Working on IIS Web Sites"
$outputObjectDisplayValue = New-Object System.Collections.Generic.List[object]
$problemCertList = New-Object System.Collections.Generic.List[string]
$exchangeBackEndBindingsList = New-Object System.Collections.Generic.List[string]
$iisWebSites = $exchangeInformation.IISSettings.IISWebSite | Sort-Object ID
$bindingsPropertyName = "Protocol - Bindings - Certificate"

Expand Down Expand Up @@ -109,6 +110,10 @@ function Invoke-AnalyzerIISInformation {
}
}

if ($website.name -eq "Exchange Back End" -and $($_.Protocol) -eq "https") {
$exchangeBackEndBindingsList.Add($($_.bindingInformation))
}

1..(($protocolLength - $_.Protocol.Length) + 1) | ForEach-Object { $pSpace += " " }
1..(($bindingInformationLength - $_.bindingInformation.Length) + 1 ) | ForEach-Object { $biSpace += " " }
return "$($_.Protocol)$($pSpace)- $($_.bindingInformation)$($biSpace)- $certHash"
Expand Down Expand Up @@ -148,6 +153,16 @@ function Invoke-AnalyzerIISInformation {
}
}

#Checking Exchange Backend Site bindings to make sure it does not bind with single IP Address.
if ($exchangeBackendBindingsList -notcontains '*:444:') {
$params = $baseParams + @{
Name = "Website Binding Issue Detected"
Details = "Make sure 'Exchange Back End' website is not bind with single IP Address"
DisplayWriteType = "Red"
}
Add-AnalyzedResultInformation @params
}

########################
# IIS Web Sites - Issues
########################
Expand Down

0 comments on commit 7dd28f5

Please sign in to comment.