Skip to content

Instantly share code, notes, and snippets.

@vScripter
Last active August 10, 2016 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vScripter/ff80797baaed06f42e542f5ae3c0dd16 to your computer and use it in GitHub Desktop.
Save vScripter/ff80797baaed06f42e542f5ae3c0dd16 to your computer and use it in GitHub Desktop.
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