jvcoach23 Posted April 27, 2005 Posted April 27, 2005 I'm trying to get the mac address of another machine.. one that I'm not running this app from. I have code that is working for getting my own.. but how do I tell it to run this against another computer. Anyone have a code synp i can use to help me along. thanks Quote JvCoach23 VB.Net newbie MS Sql Vet
Mister E Posted April 27, 2005 Posted April 27, 2005 Haven't looked at the code, but this looks like it might help. Quote
jvcoach23 Posted April 28, 2005 Author Posted April 28, 2005 Here is what I have so far.. this works for the mac address.. but the IPAddress comes up blank. From what I can tell looking around.. that info should be there when you query the Win32_NetworkAdapterConfiguration Dim ms As ManagementScope Dim co As ConnectionOptions Dim query As ManagementObjectSearcher Dim queryCollection As ManagementObjectCollection Dim oq As ObjectQuery Dim strQuery As String Dim mo As ManagementObject ms = New ManagementScope("\\" + mvcComputerName + "\root\cimv2", co) strQuery = "Select * from Win32_NetworkAdapterConfiguration" oq = New ObjectQuery(strQuery) query = New ManagementObjectSearcher(ms, oq) Try queryCollection = query.Get Catch ex As Exception Throw ex End Try For Each mo In queryCollection mMac = mo("MACAddress").ToString 'This is working mIp = mo("IPAddress").ToString 'This isn't Next Perhaps now someone might see something that I'm missing Thanks Shannon Quote JvCoach23 VB.Net newbie MS Sql Vet
jvcoach23 Posted April 29, 2005 Author Posted April 29, 2005 got it figured out.. the ip address. you have bring that back into an array and step through the array.. cause there could be more than 1 ip address per mac.. Quote JvCoach23 VB.Net newbie MS Sql Vet
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.