When managing vApps in the cloud, you might need to obtain information about the NIC settings of the associated virtual machines.

Verify that you are connected to a vCloud Director server.

1

Retrieve the organization for which you want to generate the report.

$myOrg = Get-Org -Name 'MyOrg'
2

Retrieve all vApps in the organization.

$vApps = Get-CIVApp -Org $myOrg
3

Populate an array with the information that you want to report.

$vAppNetworkAdapters = @()
foreach ($vApp in $vApps) {
        $vms = Get-CIVM -VApp $vApp
        foreach ($vm in $vms) {
                $networkAdapters = Get-CINetworkAdapter -VM $vm 
                foreach ($networkAdapter in $networkAdapters) {
                        $vAppNicInfo = New-Object "PSCustomObject"
                        $vAppNicInfo | Add-Member -MemberType NoteProperty -Name VAppName -Value $vApp.Name
                        $vAppNicInfo | Add-Member -MemberType NoteProperty -Name VMName   -Value $vm.Name
                        $vAppNicInfo | Add-Member -MemberType NoteProperty -Name NIC      -Value ("NIC" + $networkAdapter.Index)
                        $vAppNicInfo | Add-Member -MemberType NoteProperty -Name ExternalIP -Value $networkAdapter.IpAddress
                        $vAppNicInfo | Add-Member -MemberType NoteProperty -Name InternalIP -Value $networkAdapter.ExternalIpAddress

                        $vAppNetworkAdapters += $vAppNicInfo
                 }      
         }
}

Running this script retrieves the names of the virtual machines and their associated vApp, the IDs of the NICs of the virtual machines, and external, and internal IP addresses of the NICs.

4

Display the report on the screen.

$vAppNetworkAdapters