Information Technology Reference
In-Depth Information
' set a counter to number the NICs, in case you need to display info
' for more than one.
n = 1
WScript.Echo
For Each nic in nics
WScript.Echo "Network Interface Card: " & n
WScript.Echo "================="
WScript.Echo " Description: " & nic.Description
WScript.Echo " Physical (MAC) address: " & nic.MACAddress
WScript.Echo " Host name: " & nic.DNSHostName
' display all IP addresses configured for this adapter
If Not IsNull(nic.IPAddress) Then
For x = 0 To UBound(nic.IPAddress)
WScript.Echo " IP address: " & nic.IPAddress(x)
Next
End If
If Not IsNull(nic.IPSubnet) Then
For x = 0 To UBound(nic.IPSubnet)
WScript.Echo " Subnet: " & nic.IPSubnet(x)
Next
End If
If Not IsNull(nic.DefaultIPGateway) Then
For x = 0 To UBound(nic.DefaultIPGateway)
WScript.Echo " Default gateway: " & _
nic.DefaultIPGateway(x)
Next
End If
' now display DNS configuration information
WScript.Echo
WScript.Echo " DNS Settings"
WScript.Echo " ------------"
WScript.Echo " DNS search order:"
If Not IsNull(nic.DNSServerSearchOrder) Then
For x = 0 To UBound(nic.DNSServerSearchOrder)
WScript.Echo " " & nic.DNSServerSearchOrder(x)
Next
End If
Search WWH ::




Custom Search