Display all IIS sites and bindings

Here’s an quick and easy way to list all IIS Sites and their bindings:

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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top