Skip to content

Instantly share code, notes, and snippets.

@dmauser
Last active January 12, 2021 19:43
Show Gist options
  • Save dmauser/988c2d686b264c0295f8be8937435d6c to your computer and use it in GitHub Desktop.
Save dmauser/988c2d686b264c0295f8be8937435d6c to your computer and use it in GitHub Desktop.
Script dumps IP range info associated to Service Tags
#Dumping Service Tags IP Ranges.
# 1) Specify target region variable.
$serviceTags = Get-AzNetworkServiceTag -Location uksouth
# 2) Get all service tags that can be queried
$serviceTags.Values.Name
# 3) Example dumping info for SQL service tag info on UK South (SQL.uksouth). You can replace with any value dumped on step 2.
$tag = $serviceTags.Values | Where-Object { $_.Name -eq "SQL.uksouth" }
# 4) Example dumps amount of Prefixes.
$tag.Properties.AddressPrefixes.count
# 5) Example dumping all Address Spaces used by specific Serive Tag
$tag.Properties.AddressPrefixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment