In Windows Server 2019 or Windows Server 2022 Core edition, many GUI (Graphical User Interface) items are not available including IIS Manager. On Windows Server Core, pretty much almost everything is configured with PowerShell or if you use another server as a proxy then you can manage the items.

In Exchange, whether it is Exchange Server 2013, 2016 or 2019, we need to work with the bindings in IIS. I put together a script that not only shows the bindings for the “Default Web Site” but also the “Exchange Back End” site and displays the information in a table for each one.

Below is the output of the script:

PowerShell script to get Exchange 2019 bindings

Below is a snippet of IIS showing the same thing:

IIS showing the bindings

Script

Below is the code used to get the information from PowerShell:

# Import the WebAdministration module
Import-Module WebAdministration

# Function to display binding information in a table format
function Show-BindingInfo($binding) {
    [PSCustomObject]@{
        'Protocol' = $binding.Protocol
        'IP Address' = $binding.BindingInformation.Split(":")[0]
        'Port' = $binding.BindingInformation.Split(":")[1]
        'Host Header' = $binding.HostHeader
        'SSL Enabled' = $binding.SslFlags -ne 0
        'Certificate Store Name' = $binding.CertificateStoreName
    }
}

# Get the bindings for the Default Web Site
$defaultSiteName = "Default Web Site"
$defaultBindings = Get-WebBinding -Name $defaultSiteName

# Get the bindings for the Exchange Back End
$exchangeBackendSiteName = "Exchange Back End"
$exchangeBackendBindings = Get-WebBinding -Name $exchangeBackendSiteName

Write-Host "Bindings for defaultSiteName:"
$defaultBindingsTable = $defaultBindings | ForEach-Object { Show-BindingInfo $_ }
$defaultBindingsTable | Format-Table

Write-Host "Bindings for exchangeBackendSiteName:"
$exchangeBackendBindingsTable = $exchangeBackendBindings | ForEach-Object { Show-BindingInfo $_ }
$exchangeBackendBindingsTable | Format-Table

I ran the PowerShell Script directly from the Exchange Server to give me the output, simply copying and pasting the information and letting it complete.

Hope it helps.

    wpChatIcon

    Discover more from Everything-PowerShell

    Subscribe now to keep reading and get access to the full archive.

    Continue reading