The getmac (short for get MAC address) is a simple Windows network command-line utility used to find the physical address of the network adapters (NIC) in a computer. This tool is typically used in troubleshooting network issues.
The commands shown here are tested on a computer with Windows 10 but most will work in other versions of Windows as well.
The getmac is a Windows command-line utility used typically when troubleshooting network issues to retrieve the MAC address, also known as the physical address, of network adapters in a computer. The getmac will only able to retrieve MAC addresses (the 6-byte 'burned-in' physical/hardware address) of connected adapters. If an adapter is disabled (in Windows Device Manager for example), or is not connected to the network, getmac will not be able to retrieve its MAC address.
The getmac is not the only way command-line tool to identify the MAC address of a network adapter. The ipconfig utility can also be used for this purpose, along with other functions.
To use this utility, you will need to launch the Command Prompt window. The three common ways to launch the Command Prompt window are:
cmd
using the built-in Windows search tool.cmd
at the Run window that appears.getmac[.exe][/s <computer> [/u <Domain\<User> [/p <Password>]]][/fo {TABLE | list | CSV}][/nh][/v]
Parameter | Description |
---|---|
/s system | Specifies the remote system to connect to.This can be either an IP address or a host name (do not use backslashes). The default is the local computer. |
/u [domain\]user | Specifies the user context under which the command should execute. The default is the permissions of the current logged on user on the computer issuing the command. |
/p [password] | Specifies the password for the given user context. Prompts for input if omitted. |
/fo format | Specifies the format in which the output is to be displayed. Valid values: "TABLE", "LIST", "CSV". Teh default is Table. |
/nh | Specifies that the "Column Header" should not be displayed in the output. Valid only for TABLE and CSV formats. |
/v | Specifies that verbose output is displayed. |
/? | Displays help information. |
There are a variety of switches (sub commands) available with the getmac utility that will alter how it will function. At the most basic, the getmac is used without any switches enabled to displays a the MAC address of all network adapters of a computer.
To get the MAC address of the network adapters (or NIC for short) in your computer, type the following in the command window then press Enter: getmac
The screenshot example below is the getmac output of a particular computer. The output of your result will differ. In our screenshot example, it shows the MAC address (physical address) of two network adapters.
The response "Hardware not present" for the other three adapters indicated that they are currrently disabled - this command can not show MAC addresses for adapters that are disabled..
A MAC address is made up of six (6) bytes (sometimes called octets). The first three octets indicate the manufacturer of the network adapter. Use this MAC Address (OUI) Lookup Tool to learn more and to find the manufacturer of your adapter.
The getmac utility can also be used to find the MAC address of network adapters on a remote computer. To be able to do this, you will need the following information:
For example, to get the MAC address of a remote computer with a hostname johnpc, using a local administrator username johndoe and password of johnspassword, type the following in the command window then press Enter:
getmac /s johnpc /u johndoe /p johnspassword
For example, to get the MAC address of a remote computer with a hostname johnpc, using a network administrator account with username johnadmin and password of mydomainname\johnspassword, type the following in the command window then press Enter:
getmac /s johnpc /u mydomainname\johnadmin /p johnspassword
The getmac utility can only remotely retrieve MAC addresses of computers running a Windows operating system only. If you attempt use this on any other device, you will get the error The RPC server is unavailable. Thus, you will not be able to use getmac on remote devices such as printers, network routers, Android tablets, and wireless access points.
To get the MAC address of the network adapters with the results formatted in a table with extra information, type the following in the command window then press Enter: getmac /fo table /v
As the screenshot example below shows, output shows more information about the adapters.
The example usage described in the article shows only some of the functions available with getmac. To get a list of the available switches, type the following in the command window then press Enter: getmac /?
getmac > c:\temp\getmac-results.txt
An investment in knowledge always pays the best interest.
The getmac is a simple utility that can come in handy while troubleshooting network issues or to quickly look up MAC addresses. Because of its simplicity, you will likely need to use other tools to effectively troubleshoot moderate to difficult networking issues.
Back to Top