Skip to content

Instantly share code, notes, and snippets.

@timgaunt
Last active August 10, 2018 19:30
Show Gist options
  • Save timgaunt/011d8d39a48299e2b1383f60d1586d15 to your computer and use it in GitHub Desktop.
Save timgaunt/011d8d39a48299e2b1383f60d1586d15 to your computer and use it in GitHub Desktop.
List the IIS sites using PowerShell
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
Get-ChildItem -Path IIS:\Sites | findstr “https”
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment