Hello LucD,
first of all...thanks a lot for all your scripts (help) so far.
I use a lot of your scripts day by day.
Right now I struggle to extend that script.
Original:
Get-VM | Get-NetworkAdapter |
Select-Object @{N="VM";E={$_.Parent.Name}},
@{N="NIC";E={$_.Name}},
@{N="Network";E={$_.NetworkName}},
MacAddress,
@{N='IP';E={
$vNIc = $_
($_.Parent.ExtensionData.Guest.Net | where { $_.MacAddress -eq $vNIc.MacAddress }).IPAddress -join '|'
}}
I have the need to extend it with the clustername, hostname, network name from the host itself , where the VM is located and which distributed switch is used. Furthermore I have more than one networkadapter connected.
All of it should be in one line.
The list should be like that
Clustername | Hostname | Network name Host | VM name | Network adapter name | Network name VM | IP VM |
ClusterXXX | HostXXX | N_XXX 1 | N_XXX 2 | N_XXX3 | etc. | VM_XXX | Network adapter 1 | network adapater | network adapter 3 | etc. | Network name 1 | network name 2 | network name 3 | etc. | IP 1 | IP 2 | IP 3 | etc. |
I struggle over days to get it done, but my skills are not the best.
It would be greate if you could help me with that task.
Thanks a lot
Erich