Re: How can I obtain the MAC address of a remote machine via a WMI Script?



On Jun 4, 5:40 pm, "Spin" <S...@xxxxxxxxxxx> wrote:
"RD" <rdelauge...@xxxxxxxxx> wrote in message

news:76faf4d4-d409-4f98-bc21-a9ef3c8ad05d@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

It's a simple WQL request (SQL like for WMI) to list all instances of
Win32_NetworkAdapter class
then, for each of the results, it prints the MACAddress property.
So it's all WMI, works on any remote computer provided you have the
proper user rights (that is admin) on the account that runs the
script.
If you want to logon as another user, google or msdn search for
Management.ManagementScope (I use that in VB.NET)

It definitely worked. It picked up the remote MAC address of the machine
for which I intended it. It also picked up some other MAC addresses as well
which was kind of weird.

What I did was alter line 1 of the script changing it to:
strComputer = "DC1"

which resulted in it displaying the MAC of machine DC1 (DC1 has only 1 NIC,
no other NICs present at all). However the script also displayed a MAC of
50:50:54:50:30:30. Kinda weird, huh?

I know. tested it on two computers (both running win xp pro, both with
only one NIC) and on both it reports 10+ instances, with 3 differant
mac addresses.. I don't know what the others are though..
So to be sure, you can change the request to "SELECT * FROM
Win32_NetworkAdapter WHERE DeviceID=1"
If I remember correctly the mac address of the first device listed is
the good one.
Glad it helped.
.



Relevant Pages

  • Re: How can I obtain the MAC address of a remote machine via a WMI Script?
    ... then, for each of the results, it prints the MACAddress property. ... works on any remote computer provided you have the ... It picked up the remote MAC address of the machine ... What I did was alter line 1 of the script changing it to: ...
    (microsoft.public.win32.programmer.wmi)
  • Re: Cannot Ping Beyond Default Gateway & DHCP Server
    ... That computer has two ethernet NICs: one from Intel, and one from Linksys. ... He says he has never had to change a MAC nor tell the home office to change one. ... My assumption now is that this MAC control is occurring in the cable modem, and that clearing it with power off causes it to loose its previously-stored value. ... Network Diagnostics shows pings to his IP, Default Gateway, and DHCP Server work, but pings to DNS servers fail. ...
    (microsoft.public.windowsxp.network_web)
  • Re: Mac 10.4 OS on G5
    ... I called into the SBS Team Support yesterday because I was getting bombared ... changed before the Mac problem begin. ... the dual NICs on the server from teaming as Load Balance to Fault Tolerance ...
    (microsoft.public.windows.server.sbs)
  • Re: RIS, same GUID, duplicates, Dell GX60s
    ... Hence the requirement of the RIS boot disk. ... At this stage, it can't find it, so decides to get the MAC ... > these nics part of the motherboard or pci devices? ...
    (microsoft.public.windowsxp.setup_deployment)
  • Re: MAC address
    ... *All* NICs have the MAC hard coded. ... it is up to the NIC manufacturer to ... provide OS drivers that can over-ride the hardware MAC with a software MAC. ...
    (microsoft.public.win2000.general)

Quantcast