yep I confirm that the code might be complex
What do you mean by 'Version' in case of a VSS? my bad as the version is related to vDS,
What do you mean by 'Unused Adapters'? unfortunately the current configuration has some unused Uplink
Do you intend to list all pNIC that are not used in the Switch or Portgroup? it should be the case
I have the 2 below scripts, but not able to mix them in order to collect what I need
Get-VMHostNetworkAdapter -vmkernel |
% { $vnet=$_ ; get-vdportgroup -vmhostnetworkadapter $vnet |
%{"$($vnet.vmhost.parent)`t$($vnet.vmhost)`t
$($vnet.name)`t$($vnet.ip)`t$($vnet.subnetmask)`t
$($_.name)`t$($_.vdswitch)`t$($_.vlanconfiguration)" |
out-file .\temp\output.txt -append } }
Get-VirtualPortgroup -standard |
% { $pg=$_ ; get-vmhostnetworkadapter -portgroup $pg |
% { "$($_.vmhost.parent)`t$($_.vmhost)`t$($_.name)`t
$($_.ip)`t$($_.subnetmask)`t$($pg.name)`t
$($pg.virtualswitch.name)`t$($pg.vlanid)" |
out-file .\temp\output.txt -append }}
Any comments or recommendation are always welcome