MAC address, a media access control address, is a unique identifier assigned to network interfaces for communications on the physical network segment. It’s a network address on TCP/IP network that normally we don’t care about that much. But when it comes to waking up an offline computer on the same network we do need to know it before doing it.
There are many ways to get to know your local or remote computers’ MAC address but here let’s check to see how we can get this data from a PowerShell console.
To get local network adapters’ MAC address, simply use the comlet getmac which also returns a list of network protocols associated with each address.
You can also get a remote computer’s MAC addresses as well, with the switch /C.
getmac /s computername
You get a much detailed output with the switch /V.
getmac /s computername /v
Need a different output layout, try the switch /FO with the options of “Table”, “List”, or “CSV”.
getmac /s computername /v /fo list
Digging deeper, do you know that based on the MAC addresses we collected we can actually identify their network vendors. All you need is the official IEEE vendor list that you can download or call up from your PowerShell script.
The script below will download the vendor list and save it in your home directory.
$url = 'http://standards.ieee.org/develop/regauth/oui/oui.txt' $outfile = "$home\vendorlist.txt" Invoke-WebRequest -Uri $url -OutFile $outfile
then take the first 3 octets, such as E8-39-35, and do a search against the downloaded vendor list.
Heck, it even finds HP’s address, though not sure whether it’s current or not.
/credit goes to PowerShell/
Latest posts by Kent Chen (see all)
- Windows 10 Quick Tip: How To Display All CPU Cores Performance in Task Manager - March 23, 2017
- How To Batch Convert Outlook MSG Files into PDF Files on Windows - March 22, 2017
- Disabling OneDrive Ads from Displaying in File Explorer in Windows 10 - March 21, 2017
Last updated: 10/05/2014