Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • 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 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?

September 15, 2022 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

Reset Root Password in VMware ESXi

October 12, 2023

How to Fix ‘An Operating System Wasn’t Found’...

July 14, 2023

Unmounting an NFS Datastore from VMware ESXi

April 21, 2023

How to Increase Virtual Machine Disk Size in...

April 6, 2023

How to Install Free VMware Hypervisor (ESXi)

January 24, 2023

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

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
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