Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,611 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
PowerShell commands for all virtual networks and where is peered to in azure tenant.
Hi @Nana Poku,
I understand that you require all virtual networks that are peered within the tenant.
$vnets = Get-AzVirtualNetwork
foreach ($vnet in $vnets) {
Write-Host "VNet Name: $($vnet.Name)"
if ($vnet.VirtualNetworkPeerings.Count -gt 0) {
foreach ($peering in $vnet.VirtualNetworkPeerings) {
Write-Host "Peered with: $($peering.RemoteVirtualNetwork.Id)"
}
} else {
Write-Host "No peerings found."
}
}
I hope it helps.
If above is unclear and/or you are unsure about something add a comment below.
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.