Solved

Find MAC address of turned off remote computer

Posted on 2008-10-28
7
4,024 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is a how to to configure a UCS Ethernet-uplink portchannel via the console. It is easy to do and can be done quite quickly. In certain versions of the UCS manager the portchannel has issues coming up and this is a workaround. I am…
Before I go to far, let's explain HA (High Availability) and why you should consider it.  High availability is the mechanism used to provide redundancy to any service at the same site and appears as a single service to the users of that service.  As…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

829 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