Troubleshooting a strange VMware bug where certain vmxnet3 nics are coming up disconnected after a vmotion.

Add-PSSnapin vmware.vimautomation.core

Connect-VIServer <code class="powershell string">(Read-Host "</code><code class="powershell plain">Enter the name of vCenter Server</code><code class="powershell string">")</code> $VMs = get-VM * $Data = @() foreach ($VM in $VMs){ $NICs = $VM.NetworkAdapters foreach ($NIC in $NICs) { $into = New-Object PSObject Add-Member -InputObject $into -MemberType NoteProperty -Name VMname $VM.Name Add-Member -InputObject $into -MemberType NoteProperty -Name NICtype $NIC.Type Add-Member -InputObject $into -MemberType NoteProperty -Name StartConnected $NIC.ExtensionData.Connectable.StartConnected Add-Member -InputObject $into -MemberType NoteProperty -Name Connected $NIC.ExtensionData.Connectable.Connected $Data += $into } } $Data | Export-Csv -Path d:\Temp\NICs.csv -NoTypeInformation 
Get connection state of VM NICs

Leave a Reply

Your email address will not be published.