When using nbtstat -a (IP address), will it return the true MAC hardware address of the machine?
- 12,326
- 23
3 Answers
If you use nbtstat -a you need to specify a HOSTNAME.
To use an IP address, it's nbtstat -A <ip>.
Other options from Unix are arp -a (which doesn't really scan everything available).
- 12,326
- 18,014
Either:
1
Collect them from a directly connected computer, or
2
Or run a program on the local computer you are trying to get the mac from, e.g. getmac which will return output like this:

Or via vb:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select MACAddress from Win32_NetworkAdapter where DeviceID=1")
For Each objItem in colItems
Wscript.Echo "MAC Address: " & objItem.MACAddress
Next
Source of the script: this very similar question on S.U.
3
Or get them from the switches the computer is connected to. Precisely how depends on the brand of the managed switch.
4
Or write them down whenever you get new hardware and store them in a inventory database. (Mostly useful for large corporation, which will store much more information such as model, type, CPUs, RAM, helldesk calls, ...)
- 65,804
- 7
- 115
- 169
True MAC address? True MAC address? Unless you pull the NIC and take it back to the manufacturer there is truly no way of knowing for sure when there are programs that can easily change your hardware address WITHIN SECONDS...
Seconds.
- 12,326
- 3,119