VMware Cloud Community
mischief3000
Contributor
Contributor
Jump to solution

Get list of VM ip address

Hi expert,

Just wondering, whats the command to get the list of vm with ip address..i been searching but cant get the answer

hope you guys can help me

thanks

0 Kudos
1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership
Jump to solution

To get a list of virtual machines and the corresponding IP addresses you can do:

Get-VM | Select-Object -Property Name,@{N="IPAddress";E={$_.Guest.IPAddress}}

Regards, Robert

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

View solution in original post

0 Kudos
3 Replies
RvdNieuwendijk
Leadership
Leadership
Jump to solution

To get a list of virtual machines and the corresponding IP addresses you can do:

Get-VM | Select-Object -Property Name,@{N="IPAddress";E={$_.Guest.IPAddress}}

Regards, Robert

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

thank you soo much robert Smiley Happy

0 Kudos
LucD
Leadership
Leadership
Jump to solution

If you want this to also work for guests that have more than 1 IP address, you should do

Get-VM | Select-Object -Property Name,@{N="IPAddress";E={[string]::Join(',',$_.Guest.IPAddress)}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos