Quantcast
Channel: VMware Communities : Discussion List - Automation Tools
Viewing all articles
Browse latest Browse all 9071

Cisco Discovery Protocol

$
0
0

How easy would it be to get the below codes output to a spreadsheet. Ideally each column be the name of the ESXi Host and under those columns are the returned results.

Get-VMHost | Where-Object {$_.State -eq "Connected"} |
%{Get-View $_.ID} |
%{$esxname = $_.Name; Get-View $_.ConfigManager.NetworkSystem} |
%{ foreach($physnic in $_.NetworkInfo.Pnic){    $pnicInfo = $_.QueryNetworkHint($physnic.Device)    foreach($hint in $pnicInfo){      Write-Host $esxname $physnic.Device      if( $hint.ConnectedSwitchPort ) {        $hint.ConnectedSwitchPort      } else {        Write-Host "No CDP information available."; Write-Host      }    }  }
}

code found in http://kb.vmware.com/kb/1003885


Viewing all articles
Browse latest Browse all 9071

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>