Skip to content

Instantly share code, notes, and snippets.

@Bobbicus
Created May 21, 2021 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bobbicus/705b293bcc80c4b450cca12c5bb60db9 to your computer and use it in GitHub Desktop.
Save Bobbicus/705b293bcc80c4b450cca12c5bb60db9 to your computer and use it in GitHub Desktop.
aappgw_hostnames
$TenantID = "123456abc-123abc-123abc-123abc-123456abc"
$SpokeSubscription = "123456abc-123abc-123abc-123abc-123456abc"
Connect-AzAccount -TenantId $TenantID -Subscription $SpokeSubscription
$rgName="rg-name"
$appgwName="appgw-name"
$gw=Get-AzApplicationGateway -Name $appgwName -ResourceGroupName $rgName
Foreach ($listeners IN $gw.HttpListeners)
{
if($listeners.HostNames.length -gt 0)
{
Write-Output "Listener Name"
$listeners.Name
Write-Output "Hostnames"
$listeners.HostNames
Write-Output " "
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment