Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Basic script to pull an inventory of ESXi VTEP interfaces
$vtepReportPath = "$Home\Desktop\ESXi_VTEP_Report.csv"
$vtepFinalReport = @()
Get-VMHostNetworkAdapter -VMKernel | Foreach-Object {
$vtepInterfaceQuery = $null
$vtepInterfaceQuery = $_.ExtensionData | Where-Object {$_.Spec.NetStackInstanceKey -eq 'vxlan'}
foreach ($vtep in $vtepInterfaceQuery) {
$objVtepInt = @()
$objVtepInt = [PSCustomObject] @{
VMHost = $_.VMHost
Interface = $vtep.Device
MacAddress = $vtep.Spec.Mac
IPv4Address = $vtep.Spec.Ip.IpAddress
SubnetMask = $vtep.Spec.Ip.SubnetMask
DHCP = $vtep.Spec.Ip.Dhcp
MTU = $vtep.Spec.Mtu
TsoEnabled = $vtep.Spec.TsoEnabled
NetworkStack = $vtep.Spec.NetStackInstanceKey
PinnedPnic = $vtep.Spec.PinnedPnic
} # end $objVtepInt
$vtepFinalReport += $objVtepInt
} # end foreach $vtep
} # end foreach-object
$vtepFinalReport | Export-Csv -Path $vtepReportPath -NoTypeInformation -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.