VMware Cloud Community
AlbertWT
Virtuoso
Virtuoso
Jump to solution

Modifying PowerCLI script to get vMotion interface IP address ?

Hi All,

Can anyone here please help me to modify the script below so that I can get the IP address for all vmk1 and vmk2 highlighted:

vMotion.JPG

Get-VMHostNetworkAdapter -VMKernel -VMHost (get-cluster |get-vmhost) | ? {$_.PortgroupName -eq "vMotion_1" -and $_.PortgroupName -eq "vMotion_2"} | select Name,VMhost,Mac,IP,Mtu,SubnetMask | Export-Csv -Path C:\temp\HPBlades-VMotionInterfaceIPaddresss.csv

because the script above does not return anything and no error is mentioned, just blank .CSV result.

Thanks in advance.

/* Please feel free to provide any comments or input you may have. */
1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership
Jump to solution

You can use the following PowerCLI command to retrieve the vMotion IP addresses of all of your ESXi hosts:

Get-VMHost | Get-VMHostNetworkAdapter -VMKernel |

Where-Object {$_.vMotionEnabled} |

select Name,VMhost,Mac,IP,Mtu,SubnetMask

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition

View solution in original post

2 Replies
RvdNieuwendijk
Leadership
Leadership
Jump to solution

You can use the following PowerCLI command to retrieve the vMotion IP addresses of all of your ESXi hosts:

Get-VMHost | Get-VMHostNetworkAdapter -VMKernel |

Where-Object {$_.vMotionEnabled} |

select Name,VMhost,Mac,IP,Mtu,SubnetMask

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
AlbertWT
Virtuoso
Virtuoso
Jump to solution

Thanks Rob,

It works great 🙂

/* Please feel free to provide any comments or input you may have. */
Reply
0 Kudos