Jump to content


mcamero

Query to find ALL MAC addresses by PC name

Recommended Posts

Hello all,

 

First post and totally NOOB here! :)

 

I'm currently using the query below to find the LAN MAC address by entering the computer name in a prompted value.

select distinct SMS_R_System.MACAddresses, SMS_R_System.Name from  
SMS_R_System where SMS_R_System.Name = ##PRM:SMS_R_System.Name## order by 
SMS_R_System.Name

Is it even possible, and if so I'm hoping someone can help me figure out how to, query to find all MACs using the computer name in a prompted value?

 

Currently if I run the query on a laptop, it will not return the wireless MAC and this is what I'm looking for. Also, I have seen ways of running such queries but they do not differentiate between which MAC is which. Would it be better to write a script in PowerShell for this task?

Thank you!

Share this post


Link to post
Share on other sites

I do already have the query below:

select distinct SMS_R_System.Name, SMS_R_System.MACAddresses from  
SMS_R_System where SMS_R_System.MACAddresses = ##PRM:SMS_R_System.MACAddresses## 
order by SMS_R_System.MACAddresses

I believe this is what you were referencing. This allows me to obtain a computer name if I only have the MAC.

What I'm looking for is if I have the computer name and I want to find the MAC address, however on laptops there are multiple MACs so I'd like to get all of the MACs (or more specifically the Ethernet and Wireless) and I'd like them differentiated so I know which is which.

 

Thank you for the response!

Share this post


Link to post
Share on other sites

It is because you are querying the wrong thing. You query will tell you the MAC address of your clients, not of all of the MAC on the system. Instead you want SMS_G_System_NETWORK_ADAPTER.MACAddress to get all of the MAC address.

Share this post


Link to post
Share on other sites

select distinct SMS_G_System_NETWORK_ADAPTER.MACAddress, SMS_R_System.Name from  SMS_R_System where SMS_R_System.Name = ##PRM:SMS_R_System.Name## order by SMS_R_System.Name

Sorry for the late reply... I had to put this off due to more pressing issues.

 

So the code above is what I have now for my query, but this doesn't pull up any MACs for a system at all.

 

Again, my main goal here is to be able to enter a prompted value of Computer Name and get results of Ethernet Adapter Local Area Connection MAC address, as well as, Wireless LAN Adapter MAC Address.

 

Thank you all again for your help!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.