Remotely obtain MAC addresses

May 9, 2008, 05:05 PM —  ITworld.com — 

In order to create a DHCP reservation, you need to know the MAC address of the computer. The MAC address is a unique link-layer address that identifies a network interface on a computer, and MAC addresses are generally hard-coded into network interfaces although they sometimes can be changed. Often when you purchase a computer the MAC address is displayed, either on a sticker on the system or in the computer's documentation. But not always.

If you're logged on locally to a computer running Microsoft Windows, you can determine the system's MAC address by typing ipconfig /all and looking for the entry labeled Physical Address. But what if you're system is somewhere else on your network? One way of determining the MAC address of a remote system is to type nbtstat -A remoteaddress at a command prompt where remoteaddress is the IP address of the remote system. For example, when I run this against a Windows Server Core box on my test network, I get the following result:

C:\Documents and Settings\Administrator>nbtstat -A 172.44.25.222


Local Area Connection:

Node IpAddress: [172.44.25.102] Scope Id: []
  NetBIOS Remote Machine Name Table

 Name       Type                Status
 ---------------------------------------------
SEA-SC1   <00> UNIQUE   Registered
CONTOSO   <00> GROUP    Registered
SEA-SC1   <20> UNIQUE   Registered

MAC Address = 00-11-D8-60-ED-D4

 

The remote system's MAC address is the last entry in the output from the command.

An alternative to the above is to use the psexec tool from Mark Russinovich's Windows Sysinternals suite of tools. Using psexec, you can run ipconfig /all remotely on the remote machine and return the result to your local computer. Here's an example of this at work (you could also substitute the remote computer's name instead of its IP address in the below command, and you need to specify credentials that work on the remote machine):

C:\test>psexec \\172.44.25.222 -u Administrator -p Pa$$w0rd ipconfig /all


PsExec v1.94 - Execute processes remotely

Copyright (C) 2001-2008 Mark Russinovich

Sysinternals - www.sysinternals.com


Windows IP Configuration

Host Name . . . . . . . . . . . . : SEA-SC1
Primary Dns Suffix . . . . . . . : contoso.com
Node Type . . . . . . . . . . . . : Hybrid
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : contoso.com


Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . : contoso.com
Description . . . . . . . . . . . : SiS 900 PCI Fast Ethernet Adapter
Physical Address. . . . . . . . . : 00-11-D8-60-ED-D4
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::89d:8a5:5d58:512e%2(Preferred)
IPv4 Address. . . . . . . . . . . : 172.44.25.222(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.0.0

...
 

ipconfig exited on 172.16.11.222 with error code 0.

Note that if Windows Firewall is enabled on the remote computer and the File And Printer Sharing exception is turned off, neither of the above methods will work and you'll have to try something else.

One final tip: a must-have book for Windows admins is Microsoft Windows Internals (4th Edition) written by Mark Russinovich and David A. Solomon. This book not only provides you with deep insight into how Microsoft Windows works-it also shows you how to use some of the Sysinternals tools to explore the Windows operating system on your own. I hope they update this book for Windows Vista and Windows Server 2008 someday, but meantime this is the best there is for anyone who wants to dig deeper into Windows.

ITworld.com

I like it!
Post a comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
Resources
White Paper

Symantec Backup Exec 12 and Backup Exec System Recovery 8 deliver industry leading Windows data protection and system recovery. Download this whitepaper to find out the top reasons to upgrade and how to get continuous data protection and complete system recovery.

Webcast

Data and system loss — from a hard drive failure, malicious attack, natural disaster, or simple human error — can happen anytime. Don’t leave your business vulnerable. Make sure you have a secure recovery strategy in place. Symantec's latest backup and system recovery technology can efficiently restore critical applications, individual emails and documents and even restore your entire system in minutes in the event of a loss.

White Paper

Businesses face a growing challenge to ensure that the IT environment is properly protected. Backup Exec 12 integrates with other applications in the Symantec family of products, to complement your current data protection strategy, keep your data securely backed up and make it recoverable when you need it most.

Free stuff

Crimeware: Understanding New Attacks and Defenses
By Markus Jakobsson, Zulfikar Ramzan
Published Apr 6, 2008 by Addison-Wesley Professional. Part of the Symantec Press series.
Enter now! | Official rules | Sample chapter

Securing VoIP Networks: Threats, Vulnerabilities, and Countermeasures
By Peter Thermos, Ari Takanen
Published Aug 1, 2007 by Addison-Wesley Professional.
Enter now! | Official rules | Sample chapter

Featured Sponsor

AISO founders envisioned a Web hosting company that was environmentally friendly. While the company employed energy-efficient innovations like solar panels, its infrastructure produced unacceptable power and cooling requirements. Find out how AISO leveraged AMD technology to overcome their challenge in this case study white paper.

In this whitepaper, Scalar explores the opportunity to change the landscape with respect to mission critical databases built around Oracle. Leveraging technologies such as Linux, high-end commodity processing power and Oracle RAC technology to architect, design, build and maintain database infrastructure that delivers maximum availability, reliability and performance at a fraction of traditional cost.

On a typical day, weather.com, the Web site for The Weather Channel in Atlanta, serves up between 15 million and 20 million page views. But in September 2004, when back-to-back hurricanes ransacked Florida, the peak traffic on one day more than tripled: over 70 million page views by more than 7 million unique visitors. Read the full success story now.

More Resources