We can find mac address (physical address) of a computer using the command ‘getmac‘. This can be used to get mac address for remote computers also. Below are few examples on how to use this command. It works on XP, Vista, Windows 7, Server 2003 and Server 2008 operating systems.
Get mac addresses from CMD
Just run the command getmac to get the mac addresses. Find an example below.
This command does not show mac addresses for the network connections which are disabled. You can run ncpa.cpl and check which NICs are disabled. Further, I have received comments that this command does not help identify the mac address for a specific device. For example, if I need to get the mac address for my WiFi card, output of getmac command is not helpful. We can use ipconfig command to deal with this.
Get mac address of a remote computer
We can retrieve the mac addressses for a remote computer using nbtstat command.
Example:
Alternatively, We can run the below command to retrieve the mac addresses of a remote computer.
remote_computer : Full name of the remote computer or IP address
username and password are of the account on the remote computer.
Mac Address Server 2012
Example:
Use this method to obtain the MAC Address of your local computer as well as query remotely by computer name or IP Address. Hold down the “Windows Key” and press “R“. Type “CMD“, then press “Enter“. You can use one of the following commands.
- A MAC address is assigned by manufacturers and embedded into the device's network interface card - it's permanently tied to the device, which means that a MAC address cannot be changed.
- Using Windows 10: Connect to a network. This method is only applicable if you are currently.
- I want to know the unique MAC address of my Windows Server 2008 R2. When I used getmac command in command prompt I got a list of MAC addresses(6 count) under Primary Address header. Could you pleas.
- MAC Address or media access control address is a unique ID assigned to network interface cards (NICs). It is also known as a physical or hardware address. It identifies the hardware manufacturer and is used for network communication between devices in a network segment. MAC Address usually consists of six groups of two hexadecimal digits.
If you do not want to specify the password, you can skip /p parameter. You will be prompted to enter the password and the command execution will take place after that.
Errors:
Using getmac command we can retrieve the mac addresses of the machines running windows OS only. If you try this for a Linux machine you would get the error “The RPC server is unavailable.”
If you provide incorrect password, the command would fail with the error message “Logon failure: unknown user name or bad password.”
Also Read:
Windows CMD commands reference
In a Hyper-V host, the MAC addresses received by the VM’s network adapters are dynamic and are defined by the range of the host. I don’t want to repeat myself, I have written an article on this subject.
Trace Mac Address To Device
However, there are several cases that we need to have a static MAC address on a VM. For example, when we want to do DHCP Filtering or DHCP Reservations, or if an inventory service or even some application’s license is linked to a MAC address. In such a case, when we move the VM to another Hyper-V host, it must keep the same MAC address. Otherwise, if it had a dynamic address then it would get a new one.
Let’s see how we set a static MAC address to a VM in Hyper-V. As always, this can be done either through Hyper-V Manager or PowerShell.
Set static MAC address using Hyper-V Manager
First, make sure the VM is not running.
Open Hyper-V Manager and then VM settings. Here, expand the Network Adapter and go to Advanced Features.
To set the VM with a static MAC address, enable the Static option and enter the address you want.
Set static MAC address using PowerShell
This is done using the Set-VMNetworkAdapter cmdlet as you can view below.
Set-VMNetworkAdapter -VMName SRV01 -StaticMacAddress “00112233445566”
Finally, note that when you set up a static MAC address for a VM, be sure it is not within the dynamic address range generated by the Hyper-V host. If it is within the range, then it is possible to give the same address to another VM as the host does not control the management between static and dynamic addresses.