Last active
August 10, 2016 19:07
-
-
Save vScripter/ff80797baaed06f42e542f5ae3c0dd16 to your computer and use it in GitHub Desktop.
Basic script to pull an inventory of ESXi VTEP interfaces
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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