Search code examples
powershelldnsvirtual-machinepowercli

Fastest way to retrieve a list of every VMs DNS Host Name?


I would like to find the fastest and simplest way to get a list of every VMs DNS Host Name on the system. To then use this list of data for other purposes. Thanks for the help :)


Solution

  • Something like this should do it:

    Get-VM | Select Name,@{N="DNS Name";E={$_.Guest.HostName}},@{N="IP Address";E={$_.Guest.IPAddress}}