Loading
Scriptbox
 VBScript Links 
 About VBscript 
 JavaScript Links 
 About JavaScript 
 Powershell Links 
 PSCRIPT the Script Launcher 
 PowerShell Shortcut Keys 
 About Powershell 
     VBScript
    JavaScript
    Powershell
Disclaimer
Contact
Latest 10 Scripts
Script search
  :: { Category } :: 0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ
         

Search Options:  Associate  a  Network  Connection  and  an  IP  Address  

 Content of Associate a Network Connection and an IP Address.vbs
MD5 Hash: 72A19FC8CD744D9BAE3542B8F77DEAE8
strComputer = "."
strTargetAddress = "192.59.244.247"

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")

For Each objItem in colItems
arrIPAddresses = objItem.IPAddress
For Each strAddress in arrIPAddresses
If strAddress = strTargetAddress Then
strMACAddress = objItem.MacAddress
End If
Next
Next

Set colItems = objWMIService.ExecQuery _
("Select * From Win32_NetworkAdapter Where MACAddress = '" & strMACAddress & "'")

For Each objItem in colItems
If Not IsNull(objItem.NetConnectionID) Then
Wscript.Echo objItem.NetConnectionID
End If
Next



   © 2008 - 2013 Boris Toll      :: Scripts available: 6.481 ::      :: scriptbox.toll.at ::      :: powered by www.toll.at ::
  Google Entries:n/a
  Yahoo Backlinks:n/a
  Live Backlinks:n/a
  del.icio.us Bookmarks:n/a
  Technorati Links:n/a