How to fetch the Address space for a list of virtualnetworks using powershell.

Naveen Neerukattu 26 Reputation points
2022-10-09T13:02:51.477+00:00

HI Team,
How to fetch the Address space for a list of Virtual networks in a subscription using powershell script.

I am able to get the name of virtual networks but not able to get the address space .
248660-image.png

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,762 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Andreas Baumgarten 123.4K Reputation points MVP Volunteer Moderator
    2022-10-09T16:05:43.417+00:00

    Hi @Naveen Neerukattu ,

    maybe this helps to get started:

    Get-AzVirtualNetwork | Select-Object -Property Name -ExpandProperty Addressspace  
      
    Get-AzVirtualNetwork | Select-Object -Property Name -ExpandProperty Addressspace | Select-Object Name, AddressPrefixes  
    

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    2 people found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.