In this short & sweet tutorial, we will try to make our system admin’s job easier to manage the Hyper-V platform, at least I hope. Whether for export, to find who owns an IP address, or to find an available IP address, etc. You may need to know quickly what the IP addresses used by your VM on a Hyper-V host.

For this, we will rely on the Hyper-V module for PowerShell and specifically the Get-VM cmdlets.

So let’s see how to get VM IP with PowerShell

  1. Open a PowerShell console (run as administrator) and enter the following command:
    Get-VM | Get-Member
  2. The widespread property of “NetworkAdapters” benefits us, so we will select:
    Get-VM | Select-Object NetworkAdapters
  3. Again if we remade a Get-Member about this command, you will get a number of important sub-properties, we will select a few:
    Get-VM | Select-Object NetworkAdapters | Select-Object VMName, IPAddresses, switchName
  4. These properties show the mane of the VM respectively, its IP addresses (IPv4 and IPv6), and the name of the vSwitch on which the VM is connected. An equivalent alternative and order can be:
    Get-VM | Get-VMNetworkAdapter | ft VMName, IPAddresses, switchName

These methods are based on cross-examination of integrated services installed in your VMs. Either a VM Windows or Linux, the result should be returned. By cons, if the virtual machine is not turned on, you cannot obtain the IP address. Do you know another command? If so kindly share it with us!

Popular Posts You May Read

Explore more hosting insights, tips and industry updates.

How to Install PHP-MemCache Module On CentOS 5.0?

Memcached is a caching system that aims to speed up web applications by reducing loads.…

IP-Address

Public vs. Private IP Address: What’s the Difference

Every device on a network needs an IP address to communicate with other devices and…

What You Must Know Before Deciding on a Cloud Storage Service

In this world of information and technology, companies are finding different ways to improve their…