![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Locate MAC from IP with WMI I have an IP and i want to get the assocaited MAC address to it. I'd like to do this with WMI so i can easily remote to systems but the IP address in any WMI class is an array. I have the IP as a string. Thanks Justin |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Locate MAC from IP with WMI Justin Rich wrote: Quote: > I have an IP and i want to get the assocaited MAC address to it. I'd like to > do this with WMI so i can easily remote to systems but the IP address in any > WMI class is an array. I have the IP as a string. 11# $ipa | % { write-output "$_ $(nbtstat -a $_ | select-string 'MAC Address')" } 172.16.15.117 MAC Address = 00-50-56-8A-39-18 172.16.15.48 MAC Address = 00-50-56-8A-43-81 As I said, quick & dirty. ![]() -- Hal Rottenberg blog: http://halr9000.com powershell category: http://halr9000.com/article/category...ng/powershell/ |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Locate MAC from IP with WMI You can check http://scriptolog.blogspot.com/2007/...c-address.html It doesn't retrieve the MAC through WMI but sure can help. Be sure to check the comment from Jeff which suggests another cool method. Shay http://scriptolog.blogspot.com Quote: > I have an IP and i want to get the assocaited MAC address to it. I'd > like to do this with WMI so i can easily remote to systems but the IP > address in any WMI class is an array. I have the IP as a string. > > Thanks > Justin |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Locate MAC from IP with WMI Justin Rich wrote: Quote: > I have an IP and i want to get the assocaited MAC address to it. I'd like to > do this with WMI so i can easily remote to systems but the IP address in any > WMI class is an array. I have the IP as a string. 35# $ip = "209.134.176.14" 36# $nac = gwmi Win32_NetworkAdapterConfiguration -comp $ip -filter "IPEnabled = $true" 37# $nac | Where-Object {$_.IPAddress -contains $ip} | ft IPAddress,MACAddress IPAddress MACAddress --------- ---------- {209.134.176.14} 00:15:C5:53:99:53 {209.134.176.14} 00:15:C5:53:99:53 Notes: 1. gwmi = Get-WmiObject 2. Several diff ways to get your IPs into $ip...ask if you need help on that. -- Hal Rottenberg blog: http://halr9000.com powershell category: http://halr9000.com/article/category...ng/powershell/ |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Locate MAC from IP with WMI Thanks for the replies guys... Because of the way this network runs (no ICMP) a lot of that stuff wont work... i did however figure this out after some digging... here is the onliner i came up with.. works well ![]() (gwmi win32_networkadapterconfiguration | where {$_.ipaddress -eq $theip}).macaddress Thanks Justin "Justin Rich" <jrich523@xxxxxx> wrote in message news:ui9paYw6HHA.484@xxxxxx Quote: >I have an IP and i want to get the assocaited MAC address to it. I'd like >to do this with WMI so i can easily remote to systems but the IP address in >any WMI class is an array. I have the IP as a string. > > Thanks > Justin > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Cannot locate printer | General Discussion | |||
| Issue: Cannot locate the DVD-ROM | Gaming | |||
| Cant locate a folder | Vista file management | |||
| COD2, cannot locate cd/dvd-rom | Vista Games | |||
| Can't locate network | Vista networking & sharing | |||