cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

PowerCli 6.5 script to Collect all VM network port groups in an ESXi cluster

105
Views
0
Helpful
0
Comments
#Credentials
$vcenterIP = '10.10.10.10'
$vcusername = 'cisco@vc.local'
$vcpass = 'Cisco123'

#Set Variables - change file name an path as needed.  Change ESXi cluster name as needed
$vmnicscsv = '.\vmnics.csv'
$cluster = 'TestCluster'

#Connect to vCenter and gather info
Connect-VIServer -Server $vcenterIP -Protocol https -User $vcusername -Password $vcpass


Get-Cluster $cluster | Get-VM | Get-NetworkAdapter | 
Select @{N="VM";E={$_.Parent.Name}},Name,NetworkName |
export-Csv  $vmnicscsv -NoTypeInformation

Disconnect-VIServer -Server $vcenterIP -Force

CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards
This widget could not be displayed.