VMware Cloud Community
goce74
Contributor
Contributor

List Vms in each VLAN Network

Hello

Is it possible with Powersehell Vmware.VimAutomation.Cloud where i can connect to a VDC and then list all the Networks (VLAN's).

Then list all each VLAN with the VM within it ?

$vcd01="https://vcd01.abc.com"

$orgPol="s01_I_a02"

$orgvdcPolSQL="s01_I_a02_SQL"

# I connect to the CIServer

Connect-CIServer -Server $vcd01 -org $orgPol -User $script:CloudUser -Password $script:password

#Gets all visible networks within an organization.

$myOrg = Get-Org -Name $orgPol

Get-OrgNetwork -Org $myOrg | FT -AutoSize

The output is

Name                             Gateway         Org       ExternalNetwork                                    NetworkType

----                             -------         ---       ---------------                                    -----------

External_abc-ProdIntrnlApp-2614 10.255.193.1    s01_I_a02 External_a02_abc-ProdInternalApp-10.255.193.0/24  Direct 

External_abc-ProdApp-2613       10.255.192.1    s01_I_a02 External_a02_abc-ProdApp-10.255.192.0/24          Direct

How can I list all the VM's from each VLAN ?

The reason for this is we need to move servers from one VLAN to another and set it as DHCP.  The work above will be use to check the work.

Produce the VMs from within each VLAN showing the VM,Network VLAN,IP address , Manual or static.

Once we make the move then we will re-done it so that we can see that they have been moved .

Tags (1)
0 Kudos
1 Reply
goce74
Contributor
Contributor

Ok I did do some stuff

Get-CIVAppNetwork -name 'VLAN-PROD'

which give me the servers from that VLAN called VLAN-PROD.

0 Kudos