Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 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 you 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 a 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 whose IP addresses match this pattern.

1 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

How to Install Free VMware Hypervisor (ESXi)?

January 24, 2023

Using VMware Converter for P2V Migration (Physical to...

October 19, 2022

Using iPerf to Test Network Speed and Bandwidth

September 29, 2022

Adding Drivers into VMWare ESXi Installation Image

September 26, 2022

VMWare: Virtual Machine Disks Consolidation is Needed

September 16, 2022

1 comment

Chris April 2, 2021 - 5:53 pm

Very helpful post. This helped me find a rogue clone VM that popped up on our switch.

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Using Previous Command History in PowerShell Console

    January 31, 2023
  • How to Install the PowerShell Active Directory Module and Manage AD?

    January 31, 2023
  • Finding Duplicate E-mail (SMTP) Addresses in Exchange

    January 27, 2023
  • How to Delete Old User Profiles in Windows?

    January 25, 2023
  • How to Install Free VMware Hypervisor (ESXi)?

    January 24, 2023
  • How to Enable TLS 1.2 on Windows?

    January 18, 2023
  • Allow or Prevent Non-Admin Users from Reboot/Shutdown Windows

    January 17, 2023
  • Fix: Can’t Extend Volume in Windows

    January 12, 2023
  • Wi-Fi (Internet) Disconnects After Sleep or Hibernation on Windows 10/11

    January 11, 2023
  • Adding Trusted Root Certificates on Linux

    January 9, 2023

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
  • ESXi: Slow Disk Performance on HPE Gen8
  • Windows Server Licensing for Virtual Environments
  • Invalid State of a Virtual Machine on VMWare ESXi
  • Match Windows Disks to VMWare VMDK Files
  • System Logs on ESXi Host are Stored On Non-Persistent Storage
  • Configuring USB Devices Passthrough from VMWare ESXi to a Virtual Machine
  • Selecting the Number of vCPUs and Cores for a Virtual Machine
Footer Logo

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


Back To Top