PowerShell command to show all IIS site bindings.
# Display all sites and bindings in PowerShell (https://stackoverflow.com/questions/15528492/display-all-sites-and-bindings-in-powershell)
Import-Module WebAdministration
Get-WebBinding | % {
$name = $_.ItemXPath -replace '(?:.*?)name=''([^'']*)(?:.*)', '$1'
New-Object psobject -Property @{
Name = $name
Binding = $_.bindinginformation.Split(":")[-1]
}
} | Group-Object -Property Name |
Format-Table Name, @{n="Bindings";e={$_.Group.Binding -join "`n"}} -Wrap