' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Set wmi = GetObject("winmgmts:")
Set nics = wmi.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
For Each nic In nics
   WScript.Echo nic.ServiceName & " " & nic.MACAddress & ":"
   If Not IsNull(nic.IPAddress) Then
      For Each ip In nic.IPAddress
         WScript.Echo "  " & ip
      Next
   End If
Next
Set nics = Nothing
Set wmi = Nothing
