here's the code you need:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colAdapters = objWMIService.ExecQuery _
("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
n = 1
msg = ""
For Each objAdapter in colAdapters
msg = msg & "Network Adapter " & n & vbcrlf
msg = msg & "=================" & vbcrlf
msg = msg & " Description: " & objAdapter.Description & vbcrlf
msg = msg & " Physical (MAC) address: " & objAdapter.MACAddress & vbcrlf
msg = msg & " Host name: " & objAdapter.DNSHostName & vbcrlf
If Not IsNull(objAdapter.IPAddress) Then
For i = 0 To UBound(objAdapter.IPAddress)
msg = msg & " IP address: " & objAdapter.IPAddress(i) & vbcrlf
Next
End If
If Not IsNull(objAdapter.IPSubnet) Then
For i = 0 To UBound(objAdapter.IPSubnet)
msg = msg & " Subnet: " & objAdapter.IPSubnet(i) & vbcrlf
Next
End If
If Not IsNull(objAdapter.DefaultIPGateway) Then
For i = 0 To UBound(objAdapter.DefaultIPGateway)
msg = msg & " Default gateway: " & _
objAdapter.DefaultIPGateway(i) & vbcrlf
Next
End If
msg = msg & " DNS" & vbcrlf
msg = msg & " ---" & vbcrlf
msg = msg & " DNS servers in search order:"
If Not IsNull(objAdapter.DNSServerSearchOrder) Then
For i = 0 To UBound(objAdapter.DNSServerSearchOrder)
msg = msg & " " & objAdapter.DNSServerSearchOrder(i) & vbcrlf
Next
End If
msg = msg & " DNS domain: " & objAdapter.DNSDomain & vbcrlf
If Not IsNull(objAdapter.DNSDomainSuffixSearchOrder) Then
For i = 0 To UBound(objAdapter.DNSDomainSuffixSearchOrder)
msg = msg & " DNS suffix search list: " & _
objAdapter.DNSDomainSuffixSearchOrder(i) & vbcrlf
Next
End If
msg = msg & " DHCP" & vbcrlf
msg = msg & " ----" & vbcrlf
msg = msg & " DHCP enabled: " & objAdapter.DHCPEnabled & vbcrlf
msg = msg & " DHCP server: " & objAdapter.DHCPServer & vbcrlf
If Not IsNull(objAdapter.DHCPLeaseObtained) Then
utcLeaseObtained = objAdapter.DHCPLeaseObtained
strLeaseObtained = WMIDateStringToDate(utcLeaseObtained)
Else
strLeaseObtained = ""
End If
msg = msg & " DHCP lease obtained: " & strLeaseObtained & vbcrlf
If Not IsNull(objAdapter.DHCPLeaseExpires) Then
utcLeaseExpires = objAdapter.DHCPLeaseExpires
strLeaseExpires = WMIDateStringToDate(utcLeaseExpires)
Else
strLeaseExpires = ""
End If
msg = msg & " DHCP lease expires: " & strLeaseExpires & vbcrlf
msg = msg & " WINS" & vbcrlf
msg = msg & " ----" & vbcrlf
msg = msg & " Primary WINS server: " & objAdapter.WINSPrimaryServer & vbcrlf
msg = msg & " Secondary WINS server: " & objAdapter.WINSSecondaryServer & vbcrlf
n = n + 1
Next
wscript.echo msg
Function WMIDateStringToDate(utcDate)
WMIDateStringToDate = CDate(Mid(utcDate, 5, 2) & "/" & _
Mid(utcDate, 7, 2) & "/" & _
Left(utcDate, 4) & " " & _
Mid (utcDate, 9, 2) & ":" & _
Mid(utcDate, 11, 2) & ":" & _
Mid(utcDate, 13, 2))
End Function