Windows OS Hub
  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange

 Windows OS Hub / Virtualization / VMWare / VMWare: How to Find VMs by IP or MAC Address?

December 13, 2019 VMWare

VMWare: How to Find VMs by IP or MAC Address?

In the VMWare vSphere Client interface you can search virtual machines by their names only. But in some cases it is necessary to find the specific VMWare virtual machine by its IP or MAC (NIC hardware) address.

It is easier to do it using the VMWare PowerCLI that allows youy to search by different virtual machine parameters.

Run the PowerCLI console and connect to your vCenter server or ESXi host using the following command:

Connect-VIServer vcenter-hq.woshub.com -User administrator

To find a virtual machine by its MAC address, use these commands:

$vmMAC="00:52:32:DD:12:91”
Get-VM | Get-NetworkAdapter | Where-Object {$_.MacAddress –eq $vmMAC } | Select-Object Parent,Name,MacAddress

find virtual machine by mac adress via powercli

As you can see, the command has returned the name of the virtual machine with its MAC address.

You can also search for a specific MAC address directly in the virtual machine configuration files (VMX) on the VMFS datastore. Connect to your ESXi host via SSH and run the command:

find /vmfs/volumes | grep .vmx$ | while read i; do grep -i "00:52:32:DD:12:91" "$i" && echo "$i"; done

If you have VMware Tools installed on your virtual machines, you can search by the IP address of the guest operating system. For example, you have to find a VM with the specific IP address. Use the following commands:

$vmIP="192.168.1.102”
Get-VM * |where-object{$_.Guest.IPAddress -eq $vmIP}|select Name, VMHost, PowerState,GuestId,@{N="IP Address";E={@($_.guest.IPAddress[0])}}|ft

If you know only a part of the IP address, use the following command:

$vmIP="192.168.”
Get-VM * |where-object{$_.Guest.IPAddress -match $vmIP}|select Name, VMHost, PowerState,@{N="IP Address";E={@($_.guest.IPAddress[0])}} ,@{N="OS";E={$_.Guest.OSFullName}},@{N="Hostname";E={$_.Guest.HostName}}|ft

list vmware vms with ip address, os version and host name

The command will list the names and types of installed OSs of all virtual machines which IP addresses match this pattern.

0 comment
0
Facebook Twitter Google + Pinterest
previous post
The Disk is Offline Because of Policy Set by an Administrator
next post
Internal SSD/SATA Drive Shows as a Removable in Windows

Related Reading

FAQ: Live Migration of Virtual Machines with VMWare...

November 19, 2020

VMWare Error: Unable to Access a File Since...

October 1, 2020

How to Enable and Configure SNMP on VMWare...

September 7, 2020

Selecting the Number of vCPUs and Cores for...

August 18, 2020

Configuring USB Devices Passthrough from VMWare ESXi to...

August 12, 2020

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange
  • Windows 10
  • Windows 8
  • Windows 7
  • Windows Server 2016
  • Windows Server 2012 R2
  • Windows Server 2008 R2
  • PowerShell
  • VMWare
  • MS Office

Recent Posts

  • How to Configure and Connect an iSCSI Disk on Windows Server?

    January 26, 2021
  • Preparing Windows for Adobe Flash End of Life on December 31, 2020

    January 22, 2021
  • Checking User Logon History in Active Directory Domain with PowerShell

    January 22, 2021
  • How to Disable/Remove Thumbs.db File on Network Folders in Windows?

    January 21, 2021
  • MS SQL Server 2019 Installation Guide: Basic Settings and Recommendations

    January 19, 2021
  • USB Device Passthrough (Redirect) to Hyper-V Virtual Machine

    January 15, 2021
  • Windows 10: No Internet Connection After Connecting to VPN Server

    January 13, 2021
  • Updating the PowerShell Version on Windows

    December 24, 2020
  • How to Enable and Configure User Disk Quotas in Windows?

    December 23, 2020
  • Restoring Deleted Active Directory Objects/Users

    December 21, 2020

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
  • How to access VMFS Datastore from Linux, Windows and ESXi
  • Adding Third-Party Drivers into VMWare ESXi 6.7 ISO Image
  • Invalid State of a Virtual Machine on VMWare ESXi
  • Windows Server Licensing for Virtual Environments
  • ESXi: Slow Disk Performance on HPE Gen8
  • System Logs on ESXi Host are Stored On Non-Persistent Storage
  • VMware ESXi: How to Kill an Unresponsive (Stuck) Virtual Machine
Footer Logo

@2014 - 2018 - Windows OS Hub. All about operating systems for sysadmins


Back To Top