Skip to content

Instantly share code, notes, and snippets.

@Bobbicus
Created May 21, 2021 09:34
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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