Nice Tutorial 
Few more commands for Windows to get MAC -
To get mac addresses on the local computer
Just run the command getmac to get the mac addresses. Find an example below.
Code:
C:\>getmac
-------Output Sample [below] -------------
Physical Address Transport Name
=================== ==========================================================
2C-3F-45-02-1B-32 \Device\Tcpip_{7E49B486-120A-4BC2-2114-B345A4D5C5}
10-13-17-BC-12-48 Media disconnected
22-B3-C5-30-76-78 \Device\Tcpip_{213E8D2A-1DBE-4240-8301-BE6F3EACAF9D}
C:\>
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.
Code:
C:\>ipconfig /all
-------Output Sample [below] -------------
Windows IP Configuration
Host Name . . . . . . . . . . . . : PC-10234
Primary Dns Suffix . . . . . . . : mydomain.com
DNS Suffix Search List. . . . . . : mydomain.com
mydomain.com
Wireless LAN adapter Wireless Network Connection:
Connection-specific DNS Suffix . : mydomain.com
Description . . . . . . . . . . . : Intel(R) Centrino(R) Advanced-N 6205
Physical Address. . . . . . . . . : 3C-99-88-64-A1-F0
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : mydomain.com
Description . . . . . . . . . . . : Intel(R) 82579LM Gigabit Network Connection
Physical Address. . . . . . . . . : 73-2B-4F-D5-12-A0
C:\>
Get mac address of a remote computer
We can retrieve the mac addressses for a remote computer using nbtstat command.
Example:
Code:
C:\>nbtstat -a 10.63.71.55
-------Output Sample [below] -------------
Local Area Connection:
Node IpAddress: [10.59.13.47] Scope Id: []
NetBIOS Remote Machine Name Table
Name Type Status
--------------------------------------------
7CF71D1C3B05 <00> UNIQUE Registered
MAC Address = 00-00-00-00-00-00
Wireless Network Connection:
Node IpAddress: [10.63.71.58] Scope Id: []
NetBIOS Remote Machine Name Table
Name Type Status
--------------------------------------------
7CF71D1C3B05 <00> UNIQUE Registered
MAC Address = 7C-F7-1D-1C-3B-05
Local Area Connection 2:
Node IpAddress: [0.0.0.0] Scope Id: []
Host not found.
Alternatively, We can run the below command to retrieve the mac addresses of a remote computer.
Code:
getmac /s remote_computer /u username /p password
remote_computer : Full name of the remote computer or IP address
username and password are of the account on the remote computer.
Example:
Code:
C:\>getmac /S remotepc.domain.com /u administrator /p adminpassword
-------Output Sample [below] -------------
Physical Address Transport Name
=================== ==========================================================
22-15-25-9C-3A-29 Media disconnected
34-11-45-7A-9C-48 \Device\Tcpip_{678DD7BB-675D-4E4C-E0AE-A261490EBE8C}
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.”