Solved

Find MAC address of turned off remote computer

Posted on 2008-10-28
7
3,920 Views
Last Modified: 2013-11-09
I am on an enterprise level network. I would like to get the MAC address of a remote computer so that I can wake it remotely through it's NIC using the Wake on LAN utility. The remote computer is on my network in my domain.

Thanks
0
Comment
Question by:pciatto
7 Comments
 
LVL 17

Expert Comment

by:JohnGerhardt
ID: 22823152
ARP table of the switch it is connected to?
0
 
LVL 50

Expert Comment

by:Don Johnston
ID: 22823650
If the computer obtains it's IP address from a DHCP server, there may still be a binding for it on the server.

If the computer hasn't been off for more that 4 hours, there may still be an entry in the ARP cache of the default-gateway.

Other than that, I can't think of any other way to determine the MAC of powered-off PC.
0
 

Author Comment

by:pciatto
ID: 22823648
Thank you for your response.

How do I find the ARP table of the switch? What do I type in the command line? Do I need the IP address of the switch , if so, how do I obtain it?
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 50

Expert Comment

by:Don Johnston
ID: 22823655
What brand/model switch?
0
 
LVL 17

Expert Comment

by:JohnGerhardt
ID: 22823708
If you can get the IP of the switch then we can have a look..
I am sure there is a reason but is it not easier to get the machine turned on by some means and then get the MAC address...????!!!
0
 
LVL 2

Accepted Solution

by:
raffraffraff earned 125 total points
ID: 24303252
John, I think the point of the question is that he doesn't know in advance that he will need the MAC address of this PC. For example, he may needs to update a large number of Windows PCs out of business hours with a script. Active Directory doesn't store MAC addresses. Basically, he needs to  find the MAC addresses in a cache somewhere, and the only places that I can think of are the DHCP server or the router/switch.

The best option is to modify your environment so that each PC caches its MAC address somewhere useful.

I support 8000 Linux PCs for a bank, and I make use of Wake On Lan extensively, so I need MAC addresses. However, I record each MAC address when the PCs register themselves in the LDAP directory. For Windows PCs you could possibly do something similar with a startup script, making use of some Active Directory attributes that you don't require, like 'comment' or 'location':

My Windows scripting is rusty, but you might be able to get this working:

Imports System.Management
Try
 Dim MACAddress as string = ""
 Dim Query As String = _
 "SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True"
 Dim query As ManagementObjectSearcher = New ManagementObjectSearcher(Query)
 Dim queryCollection As ManagementObjectCollection = query.Get()

 ' Search for the MAC address in these results
 Dim mo As ManagementObject
 For Each mo In queryCollection
  MACAddress = mo("MacAddress").ToString().Replace(":", "")
 Exit For
 Next
 Return MACAddress
Catch ex As Exception
 Return ""
End Try

' Modify Computer Location Attribute
Set objComputer = GetObject _
("ldap://cn=computer101,cn=Computers,dc=company,dc=com")
objComputer.Put "Location" , MACAddress
objComputer.SetInfo

For each 'wake' event, you could query Active Directory (even from a Linux box running ldapsearch!) and extract the MAC address of any PC.

PS: I know this question is old, but there are no answers, and this might help somebody. Also note, PCs/Servers with multiple adapters will have problem with this script.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you’re like me and you like peace and quiet, saving money, and pretty lights, then this article is for you. For financial reasons, I buy all the Cisco equipment for my home lab second-hand. The first thing to wear out is usually one of the coo…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now